MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_topointer

Function lua_topointer

extlibs/lua/src/lapi.c:446–459  ·  view source on GitHub ↗

** Returns a pointer to the internal representation of an object. ** Note that ANSI C does not allow the conversion of a pointer to ** function to a 'void*', so the conversion here goes through ** a 'size_t'. (As the returned pointer is only informative, this ** conversion should not be a problem.) */

Source from the content-addressed store, hash-verified

444** conversion should not be a problem.)
445*/
446LUA_API const void *lua_topointer (lua_State *L, int idx) {
447 const TValue *o = index2value(L, idx);
448 switch (ttypetag(o)) {
449 case LUA_VLCF: return cast_voidp(cast_sizet(fvalue(o)));
450 case LUA_VUSERDATA: case LUA_VLIGHTUSERDATA:
451 return touserdata(o);
452 default: {
453 if (iscollectable(o))
454 return gcvalue(o);
455 else
456 return NULL;
457 }
458 }
459}
460
461
462

Callers 6

str_formatFunction · 0.85
luaL_tolstringFunction · 0.85
luaL_tolstringFunction · 0.85
xmovableFunction · 0.85
pointerMethod · 0.85
pointerMethod · 0.85

Calls 2

index2valueFunction · 0.85
touserdataFunction · 0.85

Tested by

no test coverage detected