diff options
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.45 2000/09/29 12:42:13 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.46 2000/10/02 14:47:43 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -182,7 +182,7 @@ static int hash_query (lua_State *L) { | |||
| 182 | } | 182 | } |
| 183 | else { | 183 | else { |
| 184 | Hash *t; | 184 | Hash *t; |
| 185 | luaL_checktype(L, 2, "table"); | 185 | luaL_checktype(L, 2, LUA_TTABLE); |
| 186 | t = hvalue(luaA_index(L, 2)); | 186 | t = hvalue(luaA_index(L, 2)); |
| 187 | lua_pushnumber(L, luaH_mainposition(t, luaA_index(L, 1)) - t->node); | 187 | lua_pushnumber(L, luaH_mainposition(t, luaA_index(L, 1)) - t->node); |
| 188 | } | 188 | } |
| @@ -193,7 +193,7 @@ static int hash_query (lua_State *L) { | |||
| 193 | static int table_query (lua_State *L) { | 193 | static int table_query (lua_State *L) { |
| 194 | const Hash *t; | 194 | const Hash *t; |
| 195 | int i = luaL_opt_int(L, 2, -1); | 195 | int i = luaL_opt_int(L, 2, -1); |
| 196 | luaL_checktype(L, 1, "table"); | 196 | luaL_checktype(L, 1, LUA_TTABLE); |
| 197 | t = hvalue(luaA_index(L, 1)); | 197 | t = hvalue(luaA_index(L, 1)); |
| 198 | if (i == -1) { | 198 | if (i == -1) { |
| 199 | lua_pushnumber(L, t->size); | 199 | lua_pushnumber(L, t->size); |
| @@ -238,7 +238,7 @@ static int string_query (lua_State *L) { | |||
| 238 | 238 | ||
| 239 | 239 | ||
| 240 | static int tref (lua_State *L) { | 240 | static int tref (lua_State *L) { |
| 241 | luaL_checktype(L, 1, "any"); | 241 | luaL_checkany(L, 1); |
| 242 | lua_pushvalue(L, 1); | 242 | lua_pushvalue(L, 1); |
| 243 | lua_pushnumber(L, lua_ref(L, luaL_opt_int(L, 2, 1))); | 243 | lua_pushnumber(L, lua_ref(L, luaL_opt_int(L, 2, 1))); |
| 244 | return 1; | 244 | return 1; |
| @@ -262,7 +262,7 @@ static int newuserdata (lua_State *L) { | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | static int udataval (lua_State *L) { | 264 | static int udataval (lua_State *L) { |
| 265 | luaL_checktype(L, 1, "userdata"); | 265 | luaL_checktype(L, 1, LUA_TUSERDATA); |
| 266 | lua_pushnumber(L, (int)lua_touserdata(L, 1)); | 266 | lua_pushnumber(L, (int)lua_touserdata(L, 1)); |
| 267 | return 1; | 267 | return 1; |
| 268 | } | 268 | } |
| @@ -290,7 +290,7 @@ static int loadlib (lua_State *L) { | |||
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | static int closestate (lua_State *L) { | 292 | static int closestate (lua_State *L) { |
| 293 | luaL_checktype(L, 1, "userdata"); | 293 | luaL_checktype(L, 1, LUA_TUSERDATA); |
| 294 | lua_close((lua_State *)lua_touserdata(L, 1)); | 294 | lua_close((lua_State *)lua_touserdata(L, 1)); |
| 295 | return 0; | 295 | return 0; |
| 296 | } | 296 | } |
| @@ -299,7 +299,7 @@ static int doremote (lua_State *L) { | |||
| 299 | lua_State *L1; | 299 | lua_State *L1; |
| 300 | const char *code = luaL_check_string(L, 2); | 300 | const char *code = luaL_check_string(L, 2); |
| 301 | int status; | 301 | int status; |
| 302 | luaL_checktype(L, 1, "userdata"); | 302 | luaL_checktype(L, 1, LUA_TUSERDATA); |
| 303 | L1 = (lua_State *)lua_touserdata(L, 1); | 303 | L1 = (lua_State *)lua_touserdata(L, 1); |
| 304 | status = lua_dostring(L1, code); | 304 | status = lua_dostring(L1, code); |
| 305 | if (status != 0) { | 305 | if (status != 0) { |
| @@ -316,7 +316,7 @@ static int doremote (lua_State *L) { | |||
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | static int settagmethod (lua_State *L) { | 318 | static int settagmethod (lua_State *L) { |
| 319 | luaL_checktype(L, 3, "any"); | 319 | luaL_checkany(L, 3); |
| 320 | lua_settagmethod(L, luaL_check_int(L, 1), luaL_check_string(L, 2)); | 320 | lua_settagmethod(L, luaL_check_int(L, 1), luaL_check_string(L, 2)); |
| 321 | return 1; | 321 | return 1; |
| 322 | } | 322 | } |
| @@ -436,7 +436,7 @@ static int testC (lua_State *L) { | |||
| 436 | lua_dostring(L, luaL_check_string(L, getnum)); | 436 | lua_dostring(L, luaL_check_string(L, getnum)); |
| 437 | } | 437 | } |
| 438 | else if EQ("type") { | 438 | else if EQ("type") { |
| 439 | lua_pushstring(L, lua_type(L, getnum)); | 439 | lua_pushstring(L, lua_typename(L, lua_type(L, getnum))); |
| 440 | } | 440 | } |
| 441 | else luaL_verror(L, "unknown instruction %.30s", buff); | 441 | else luaL_verror(L, "unknown instruction %.30s", buff); |
| 442 | } | 442 | } |
