diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -187,7 +187,7 @@ LUA_API void lua_settop (lua_State *L, int idx) { | |||
| 187 | api_check(L, idx <= ci->top.p - (func + 1), "new top too large"); | 187 | api_check(L, idx <= ci->top.p - (func + 1), "new top too large"); |
| 188 | diff = ((func + 1) + idx) - L->top.p; | 188 | diff = ((func + 1) + idx) - L->top.p; |
| 189 | for (; diff > 0; diff--) | 189 | for (; diff > 0; diff--) |
| 190 | setnilvalue(s2v(L->top.p++)); /* clear new slots */ | 190 | setnilvalue2s(L->top.p++); /* clear new slots */ |
| 191 | } | 191 | } |
| 192 | else { | 192 | else { |
| 193 | api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top"); | 193 | api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top"); |
| @@ -210,7 +210,7 @@ LUA_API void lua_closeslot (lua_State *L, int idx) { | |||
| 210 | api_check(L, (L->ci->callstatus & CIST_TBC) && (L->tbclist.p == level), | 210 | api_check(L, (L->ci->callstatus & CIST_TBC) && (L->tbclist.p == level), |
| 211 | "no variable to close at given level"); | 211 | "no variable to close at given level"); |
| 212 | level = luaF_close(L, level, CLOSEKTOP, 0); | 212 | level = luaF_close(L, level, CLOSEKTOP, 0); |
| 213 | setnilvalue(s2v(level)); | 213 | setnilvalue2s(level); |
| 214 | lua_unlock(L); | 214 | lua_unlock(L); |
| 215 | } | 215 | } |
| 216 | 216 | ||
| @@ -513,7 +513,7 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) { | |||
| 513 | 513 | ||
| 514 | LUA_API void lua_pushnil (lua_State *L) { | 514 | LUA_API void lua_pushnil (lua_State *L) { |
| 515 | lua_lock(L); | 515 | lua_lock(L); |
| 516 | setnilvalue(s2v(L->top.p)); | 516 | setnilvalue2s(L->top.p); |
| 517 | api_incr_top(L); | 517 | api_incr_top(L); |
| 518 | lua_unlock(L); | 518 | lua_unlock(L); |
| 519 | } | 519 | } |
| @@ -570,7 +570,7 @@ LUA_API const char *lua_pushexternalstring (lua_State *L, | |||
| 570 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { | 570 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
| 571 | lua_lock(L); | 571 | lua_lock(L); |
| 572 | if (s == NULL) | 572 | if (s == NULL) |
| 573 | setnilvalue(s2v(L->top.p)); | 573 | setnilvalue2s(L->top.p); |
| 574 | else { | 574 | else { |
| 575 | TString *ts; | 575 | TString *ts; |
| 576 | ts = luaS_new(L, s); | 576 | ts = luaS_new(L, s); |
| @@ -743,7 +743,7 @@ LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { | |||
| 743 | 743 | ||
| 744 | static int finishrawget (lua_State *L, lu_byte tag) { | 744 | static int finishrawget (lua_State *L, lu_byte tag) { |
| 745 | if (tagisempty(tag)) /* avoid copying empty items to the stack */ | 745 | if (tagisempty(tag)) /* avoid copying empty items to the stack */ |
| 746 | setnilvalue(s2v(L->top.p)); | 746 | setnilvalue2s(L->top.p); |
| 747 | api_incr_top(L); | 747 | api_incr_top(L); |
| 748 | lua_unlock(L); | 748 | lua_unlock(L); |
| 749 | return novariant(tag); | 749 | return novariant(tag); |
| @@ -836,7 +836,7 @@ LUA_API int lua_getiuservalue (lua_State *L, int idx, int n) { | |||
| 836 | o = index2value(L, idx); | 836 | o = index2value(L, idx); |
| 837 | api_check(L, ttisfulluserdata(o), "full userdata expected"); | 837 | api_check(L, ttisfulluserdata(o), "full userdata expected"); |
| 838 | if (n <= 0 || n > uvalue(o)->nuvalue) { | 838 | if (n <= 0 || n > uvalue(o)->nuvalue) { |
| 839 | setnilvalue(s2v(L->top.p)); | 839 | setnilvalue2s(L->top.p); |
| 840 | t = LUA_TNONE; | 840 | t = LUA_TNONE; |
| 841 | } | 841 | } |
| 842 | else { | 842 | else { |
