| 44 | } |
| 45 | |
| 46 | LUA_API int xlua_tocsobj_safe(lua_State *L,int index) { |
| 47 | int *udata = (int *)lua_touserdata (L,index); |
| 48 | if (udata != NULL) { |
| 49 | if (lua_getmetatable(L,index)) { |
| 50 | lua_pushlightuserdata(L, &tag); |
| 51 | lua_rawget(L,-2); |
| 52 | if (!lua_isnil (L,-1)) { |
| 53 | lua_pop (L, 2); |
| 54 | return *udata; |
| 55 | } |
| 56 | lua_pop (L, 2); |
| 57 | } |
| 58 | } |
| 59 | return -1; |
| 60 | } |
| 61 | |
| 62 | LUA_API int xlua_tocsobj_fast (lua_State *L,int index) { |
| 63 | int *udata = (int *)lua_touserdata (L,index); |
nothing calls this directly
no test coverage detected