void show_slider(GuiObject * slid) { check_object(slid, "slid", "show_slider"); check_window(slid->win, "show_slider"); update_slider(slid); show_window(slid->win); }
int SDL_VoutOverlayAMediaCodec_releaseFrame_l(SDL_VoutOverlay *overlay, SDL_AMediaCodec *acodec, bool render) { if (!check_object(overlay, __func__)) return -1; SDL_VoutOverlay_Opaque *opaque = overlay->opaque; return SDL_VoutAndroid_releaseBufferProxyP_l(opaque->vout, &opaque->buffer_proxy, render); }
void show_number(GuiObject * obj) { check_object(obj, "obj", "show_number"); check_window(obj->win, "show_number"); update_number(obj); show_window(obj->win); }
void create_number(GuiObject * obj) { check_object(obj, "obj", "create_number"); memset(obj->data[0], obj->bg_col1, obj->width * obj->height); string_to_data(obj->label, 0, 0, obj->width, obj->height, obj->fg_col, obj->data[0], bigfont_width, bigfont_height, bigfont); win_object(obj); }
static int l_Size( lua_State* L ) { uiImage *i = (uiImage*) check_object( L, 1, uiImageSignature ); int width = -1, height = -1; uiImageSize( i, &width, &height ); lua_pushinteger( L, width ); lua_pushinteger( L, height ); return 2; }
void set_slider_maxvalue(GuiObject * slid, float max) { check_object(slid, "slid", "set_slider_maxvalue"); if (max > 999) max = 999; slid->max_value = max; create_slider(slid); }
static lua_apr_dir *checkdir(lua_State *L, int idx, int check_open) { lua_apr_dir *object; object = check_object(L, idx, &lua_apr_dir_type); if (check_open && object->handle == NULL) luaL_error(L, "attempt to use a closed directory"); return object; }
static int l_uiColorButtonColor( lua_State* L ) { double r,g,b,a; uiColorButtonColor( (uiColorButton*) check_object( L, 1, uiColorButtonSignature ), &r, &g, &b, &a ); lua_pushnumber( L, r ); lua_pushnumber( L, g ); lua_pushnumber( L, b ); lua_pushnumber( L, a ); return 4; }
int l_uiFormAppend( lua_State* L ) { uiFormAppend( (uiForm*) check_object( L, 1, uiFormSignature ), luaL_checkstring( L, 2 ), check_control( L, 3, 0 ), lua_toboolean( L, 4 ) ); lua_pushvalue( L, 1 ); return 1; }
static int l_uiColorButtonSetColor( lua_State* L ) { uiColorButtonSetColor( (uiColorButton*) check_object( L, 1, uiColorButtonSignature ), luaL_checknumber( L, 2 ), // r luaL_checknumber( L, 3 ), // g luaL_checknumber( L, 4 ), // b luaL_checknumber( L, 5 ) ); // a lua_pushvalue( L, 1 ); return 1; }
static noinline int free_debug_processing(struct kmem_cache *s, struct page *page, void *object, unsigned long addr) { unsigned long flags; int rc = 0; local_irq_save(flags); slab_lock(page); if (!check_slab(s, page)) goto fail; if (!check_valid_pointer(s, page, object)) { slab_err(s, page, "Invalid object pointer 0x%p", object); goto fail; } if (on_freelist(s, page, object)) { object_err(s, page, object, "Object already free"); goto fail; } if (!check_object(s, page, object, SLUB_RED_ACTIVE)) goto out; if (unlikely(s != page->slab)) { if (!PageSlab(page)) { slab_err(s, page, "Attempt to free object(0x%p) " "outside of slab", object); } else if (!page->slab) { printk(KERN_ERR "SLUB <none>: no slab for object 0x%p.\n", object); dump_stack(); } else object_err(s, page, object, "page slab pointer corrupt."); goto fail; } if (s->flags & SLAB_STORE_USER) set_track(s, object, TRACK_FREE, addr); trace(s, page, object, 0); init_object(s, object, SLUB_RED_INACTIVE); rc = 1; out: slab_unlock(page); local_irq_restore(flags); return rc; fail: slab_fix(s, "Object at 0x%p not freed", object); goto out; }
static PyObject * lapack_lite_dgelsd(PyObject *NPY_UNUSED(self), PyObject *args) { int lapack_lite_status; int m; int n; int nrhs; PyObject *a; int lda; PyObject *b; int ldb; PyObject *s; double rcond; int rank; PyObject *work; PyObject *iwork; int lwork; int info; TRY(PyArg_ParseTuple(args,"iiiOiOiOdiOiOi", &m,&n,&nrhs,&a,&lda,&b,&ldb,&s,&rcond, &rank,&work,&lwork,&iwork,&info)); TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dgelsd")); TRY(check_object(b,NPY_DOUBLE,"b","NPY_DOUBLE","dgelsd")); TRY(check_object(s,NPY_DOUBLE,"s","NPY_DOUBLE","dgelsd")); TRY(check_object(work,NPY_DOUBLE,"work","NPY_DOUBLE","dgelsd")); TRY(check_object(iwork,NPY_INT,"iwork","NPY_INT","dgelsd")); lapack_lite_status = FNAME(dgelsd)(&m,&n,&nrhs,DDATA(a),&lda,DDATA(b),&ldb, DDATA(s),&rcond,&rank,DDATA(work),&lwork, IDATA(iwork),&info); if (PyErr_Occurred()) { return NULL; } return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:d,s:i,s:i,s:i}","dgelsd_", lapack_lite_status,"m",m,"n",n,"nrhs",nrhs, "lda",lda,"ldb",ldb,"rcond",rcond,"rank",rank, "lwork",lwork,"info",info); }
/* WriteObject */ static short gso_write_object(ATOMID idfName, ATOMID idName) { OBJECTID idObj = Kpp_GetItem(OBJECT, idName); if (!check_object(idObj, idName, idfName, FALSE)) return NULL; kpc_write_thing(idObj, (void (PEXPORT *)(ITEMID, FARFILE)) KppSaveObject); KappaReturnAtom(idName); }
static int tab_append( lua_State* L ) { uiTab* t = (uiTab*) check_object( L, 1, uiTabSignature ); uiControl* c = check_control( L, 3, 0 ); uiTabAppend( t, luaL_checkstring( L, 2 ), c ); if( lua_isboolean( L, 4 ) ) { uiTabSetMargined( t, uiTabNumPages( t ) - 1, lua_toboolean( L, 4 ) ); } lua_pushvalue( L, 1 ); return 1; }
static lua_apr_xml_object *check_xml_parser(lua_State *L, int idx, object_state state) { lua_apr_xml_object *object; object = check_object(L, idx, &lua_apr_xml_type); if (state == CHECK_PARSER && object->parser == NULL) luaL_error(L, "attempt to use a closed XML parser"); if (state == CHECK_DOCUMENT && object->doc == NULL) luaL_error(L, "no parse information available"); return object; }
static int l_Load( lua_State* L ) { uiImage* i = (uiImage*) check_object( L, 1, uiImageSignature ); if( uiImageLoad( i, luaL_checkstring( L, 2 ) ) ) { lua_pushvalue( L, 1 ); return 1; } luaL_error( L, "libui: image could not be loaded." ); return 0; }
__private_extern__ void checkout( struct arch *archs, unsigned long narchs) { unsigned long i, j; for(i = 0; i < narchs; i++){ if(archs[i].type == OFILE_ARCHIVE){ for(j = 0; j < archs[i].nmembers; j++){ if(archs[i].members[j].type == OFILE_Mach_O){ check_object(archs + i, archs[i].members + j, archs[i].members[j].object); } } } else if(archs[i].type == OFILE_Mach_O){ check_object(archs + i, NULL, archs[i].object); } } }
static PyObject * lapack_lite_dorgqr(PyObject *NPY_UNUSED(self), PyObject *args) { int lapack_lite_status; int m, n, k, lwork; PyObject *a, *tau, *work; int lda; int info; TRY(PyArg_ParseTuple(args,"iiiOiOOii", &m, &n, &k, &a, &lda, &tau, &work, &lwork, &info)); TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dorgqr")); TRY(check_object(tau,NPY_DOUBLE,"tau","NPY_DOUBLE","dorgqr")); TRY(check_object(work,NPY_DOUBLE,"work","NPY_DOUBLE","dorgqr")); lapack_lite_status = FNAME(dorgqr)(&m, &n, &k, DDATA(a), &lda, DDATA(tau), DDATA(work), &lwork, &info); if (PyErr_Occurred()) { return NULL; } return Py_BuildValue("{s:i,s:i}","dorgqr_",lapack_lite_status, "info",info); }
decision_t rule_evaluate(lnode *r, event_t *e) { int d; // Check the subject d = check_subject(r, e); if (d == 0) // No match return NO_OPINION; // Check the object d = check_object(r, e); if (d == 0) // No match return NO_OPINION; return r->d; }
static int l_uiImageBoxSetImage( lua_State* L ) { uiImageBox* i = (uiImageBox*) check_object( L, 1, uiImageBoxSignature ); if( lua_isnoneornil( L, 2 ) ) { uiImageBoxSetImage( i, 0 ); } else { uiImageBoxSetImage( i, check_image( L, 2 ) ); } lua_pushvalue( L, 1 ); return 1; }
int l_uiGridAppend( lua_State* L ) { uiGrid* g = (uiGrid*) check_object( L, 1, uiGridSignature ); uiControl* c = check_control( L, 2, 0 ); int left = luaL_checkinteger( L, 3 ); int top = luaL_checkinteger( L, 4 ); int xspan = luaL_optinteger( L, 5, 1 ); int yspan = luaL_optinteger( L, 6, 1 ); int hexpand = luaL_optinteger( L, 7, 1 ); uiAlign halign = luaL_optinteger( L, 8, uiAlignFill ); int vexpand = luaL_optinteger( L, 9, 1 ); uiAlign valign = luaL_optinteger( L, 10, uiAlignFill ); uiGridAppend( g, c, left, top, xspan, yspan, hexpand, halign, vexpand, valign ); lua_pushvalue( L, 1 ); return 1; }
void count_malloced_strings(int force) { extern struct svalue *sp; extern struct svalue start_of_stack[]; extern struct object *obj_list; extern struct call *call_list; struct marker_chunk *m,*next; struct object *o; struct call *cop; /* init */ level=force; hashsize=4711; hashed=0; malloced_strings=0; malloced_string_size=0; malloced_strings_shared=0; malloced_strings_shared_size=0; hash=(struct marker **)xalloc(sizeof(struct marker **)*hashsize); memset((char *)hash,0,sizeof(struct marker **)*hashsize); markers_left_in_chunk=0; check_svalues(start_of_stack, sp-start_of_stack+1); for(o=obj_list;o;o=o->next_all) check_object(o); for(cop=call_list;cop;cop=cop->next) check_svalues(&cop->v, 1); add_message("Malloced strings: %d\n", malloced_strings); add_message("Total size : %d\n", malloced_string_size); if(level>0) { add_message("Of those, shared: %d\n", malloced_strings_shared); add_message("Size of those : %d\n", malloced_strings_shared_size); } /* cleanup */ free((char *)hash); while(m=chunk) { chunk=m->next; free((char *)m); } }
static void move_slider(GuiObject * slid, int pos_neg) { GuiWinThread *win_thread; check_object(slid, "slid", "move_slider"); check_window(slid->win, "move_slider"); win_thread = (slid->win)->win_thread; do { usleep(sleep_time); do_window_functions(win_thread); new_position(slid, pos_neg); if (GuiGetMessage() == GuiMouseEvent) move_mouse(); } while (GuiMouseGetButton() == GuiMouseLeftButton); }
int SDL_VoutOverlayAMediaCodec_attachFrame( SDL_VoutOverlay *overlay, SDL_AMediaCodec *acodec, int output_buffer_index, SDL_AMediaCodecBufferInfo *buffer_info) { if (!check_object(overlay, __func__)) return -1; SDL_VoutOverlay_Opaque *opaque = overlay->opaque; opaque->acodec = acodec; opaque->buffer_index = output_buffer_index; opaque->buffer_info = *buffer_info; opaque->is_buffer_own = true; SDL_AMediaCodec_increaseReference(acodec); return 0; }
static void check_connectivity(void) { int i, max; /* Traverse the pending reachable objects */ traverse_reachable(); /* Look up all the requirements, warn about missing objects.. */ max = get_max_object_index(); if (verbose) fprintf(stderr, "Checking connectivity (%d objects)\n", max); for (i = 0; i < max; i++) { struct object *obj = get_indexed_object(i); if (obj) check_object(obj); } }
static int l_uiButtonText( lua_State* L ) { char* s = uiButtonText( (uiButton*) check_object( L, 1, uiButtonSignature ) ); lua_pushstring( L, s ); return 1; }
static int l_Destroy( lua_State* L ) { uiImage *i = (uiImage*) check_object( L, 1, uiImageSignature ); uiImageDestroy( i ); return 0; }
static int l_Valid( lua_State* L ) { uiImage *i = (uiImage*) check_object( L, 1, uiImageSignature ); lua_pushboolean( L, uiImageValid( i ) ); return 1; }
uiImage* check_image( lua_State* L, int index ) { return (uiImage*) check_object( L, index, uiImageSignature ); }
header_t *check_header(lua_State *L, int arg) { return (header_t *)check_object(L, arg, SE_OBJ_TYPE_HEADER, SE_OBJ_NAME_HEADER); }