fix compilation error due to warning

pull/81/head 0.11
Dibyendu Majumdar 9 years ago
parent 99d71b7bbc
commit 6e6f31835e

@ -67,7 +67,7 @@ static void l_getmetatable(lua_State *L, const char *meta_key) {
// meta_key is the key assigned to the meta table of the userdata // meta_key is the key assigned to the meta table of the userdata
static void *l_testudata(lua_State *L, int arg_index, const char *meta_key) { static void *l_testudata(lua_State *L, int arg_index, const char *meta_key) {
void *p = lua_touserdata(L, arg_index); void *p = lua_touserdata(L, arg_index);
int n = lua_gettop(L); //int n = lua_gettop(L);
if (p != NULL) { // value is a userdata? if (p != NULL) { // value is a userdata?
if (lua_getmetatable(L, arg_index)) { // does it have a metatable? if (lua_getmetatable(L, arg_index)) { // does it have a metatable?
lua_pushlightuserdata(L, (void *)meta_key); // meta_key lua_pushlightuserdata(L, (void *)meta_key); // meta_key
@ -79,7 +79,7 @@ static void *l_testudata(lua_State *L, int arg_index, const char *meta_key) {
lua_pop(L, 2); // remove both metatables lua_pop(L, 2); // remove both metatables
} }
} }
lua_assert(n == lua_gettop(L)); //lua_assert(n == lua_gettop(L));
return p; /* to avoid warnings */ return p; /* to avoid warnings */
} }

Loading…
Cancel
Save