MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_topointer

Function lua_topointer

third-party/lua-5.5.0/src/lapi.c:492–505  ·  view source on GitHub ↗

** Returns a pointer to the internal representation of an object. ** Note that ISO 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

490** conversion should not be a problem.)
491*/
492LUA_API const void *lua_topointer (lua_State *L, int idx) {
493 const TValue *o = index2value(L, idx);
494 switch (ttypetag(o)) {
495 case LUA_VLCF: return cast_voidp(cast_sizet(fvalue(o)));
496 case LUA_VUSERDATA: case LUA_VLIGHTUSERDATA:
497 return touserdata(o);
498 default: {
499 if (iscollectable(o))
500 return gcvalue(o);
501 else
502 return NULL;
503 }
504 }
505}
506
507
508

Callers 4

str_formatFunction · 0.70
luaL_tolstringFunction · 0.70
ToPointerFunction · 0.50
GetVariableMethod · 0.50

Calls 2

index2valueFunction · 0.70
touserdataFunction · 0.70

Tested by

no test coverage detected