diff options
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.191 2006/06/02 15:34:00 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.192 2006/09/11 14:07:24 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -264,7 +264,7 @@ static int luaB_ipairs (lua_State *L) { | |||
264 | 264 | ||
265 | 265 | ||
266 | static int load_aux (lua_State *L, int status) { | 266 | static int load_aux (lua_State *L, int status) { |
267 | if (status == 0) /* OK? */ | 267 | if (status == LUA_OK) |
268 | return 1; | 268 | return 1; |
269 | else { | 269 | else { |
270 | lua_pushnil(L); | 270 | lua_pushnil(L); |
@@ -325,7 +325,7 @@ static int luaB_load (lua_State *L) { | |||
325 | static int luaB_dofile (lua_State *L) { | 325 | static int luaB_dofile (lua_State *L) { |
326 | const char *fname = luaL_optstring(L, 1, NULL); | 326 | const char *fname = luaL_optstring(L, 1, NULL); |
327 | int n = lua_gettop(L); | 327 | int n = lua_gettop(L); |
328 | if (luaL_loadfile(L, fname) != 0) lua_error(L); | 328 | if (luaL_loadfile(L, fname) != LUA_OK) lua_error(L); |
329 | lua_call(L, 0, LUA_MULTRET); | 329 | lua_call(L, 0, LUA_MULTRET); |
330 | return lua_gettop(L) - n; | 330 | return lua_gettop(L) - n; |
331 | } | 331 | } |
@@ -373,7 +373,7 @@ static int luaB_pcall (lua_State *L) { | |||
373 | int status; | 373 | int status; |
374 | luaL_checkany(L, 1); | 374 | luaL_checkany(L, 1); |
375 | status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0); | 375 | status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0); |
376 | lua_pushboolean(L, (status == 0)); | 376 | lua_pushboolean(L, (status == LUA_OK)); |
377 | lua_insert(L, 1); | 377 | lua_insert(L, 1); |
378 | return lua_gettop(L); /* return status + all results */ | 378 | return lua_gettop(L); /* return status + all results */ |
379 | } | 379 | } |
@@ -385,7 +385,7 @@ static int luaB_xpcall (lua_State *L) { | |||
385 | lua_settop(L, 2); | 385 | lua_settop(L, 2); |
386 | lua_insert(L, 1); /* put error function under function to be called */ | 386 | lua_insert(L, 1); /* put error function under function to be called */ |
387 | status = lua_pcall(L, 0, LUA_MULTRET, 1); | 387 | status = lua_pcall(L, 0, LUA_MULTRET, 1); |
388 | lua_pushboolean(L, (status == 0)); | 388 | lua_pushboolean(L, (status == LUA_OK)); |
389 | lua_replace(L, 1); | 389 | lua_replace(L, 1); |
390 | return lua_gettop(L); /* return status + all results */ | 390 | return lua_gettop(L); /* return status + all results */ |
391 | } | 391 | } |
@@ -481,13 +481,13 @@ static int auxresume (lua_State *L, lua_State *co, int narg) { | |||
481 | int status; | 481 | int status; |
482 | if (!lua_checkstack(co, narg)) | 482 | if (!lua_checkstack(co, narg)) |
483 | luaL_error(L, "too many arguments to resume"); | 483 | luaL_error(L, "too many arguments to resume"); |
484 | if (lua_status(co) == 0 && lua_gettop(co) == 0) { | 484 | if (lua_status(co) == LUA_OK && lua_gettop(co) == 0) { |
485 | lua_pushliteral(L, "cannot resume dead coroutine"); | 485 | lua_pushliteral(L, "cannot resume dead coroutine"); |
486 | return -1; /* error flag */ | 486 | return -1; /* error flag */ |
487 | } | 487 | } |
488 | lua_xmove(L, co, narg); | 488 | lua_xmove(L, co, narg); |
489 | status = lua_resume(co, narg); | 489 | status = lua_resume(co, narg); |
490 | if (status == 0 || status == LUA_YIELD) { | 490 | if (status == LUA_OK || status == LUA_YIELD) { |
491 | int nres = lua_gettop(co); | 491 | int nres = lua_gettop(co); |
492 | if (!lua_checkstack(L, nres)) | 492 | if (!lua_checkstack(L, nres)) |
493 | luaL_error(L, "too many results to resume"); | 493 | luaL_error(L, "too many results to resume"); |
@@ -565,7 +565,7 @@ static int luaB_costatus (lua_State *L) { | |||
565 | case LUA_YIELD: | 565 | case LUA_YIELD: |
566 | lua_pushliteral(L, "suspended"); | 566 | lua_pushliteral(L, "suspended"); |
567 | break; | 567 | break; |
568 | case 0: { | 568 | case LUA_OK: { |
569 | lua_Debug ar; | 569 | lua_Debug ar; |
570 | if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ | 570 | if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ |
571 | lua_pushliteral(L, "normal"); /* it is running */ | 571 | lua_pushliteral(L, "normal"); /* it is running */ |