diff options
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.86 2000/08/28 17:57:04 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.87 2000/08/29 14:33:31 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -92,7 +92,7 @@ void luaD_adjusttop (lua_State *L, StkId base, int extra) { | |||
| 92 | /* | 92 | /* |
| 93 | ** Open a hole inside the stack at `pos' | 93 | ** Open a hole inside the stack at `pos' |
| 94 | */ | 94 | */ |
| 95 | void luaD_openstack (lua_State *L, StkId pos) { | 95 | static void luaD_openstack (lua_State *L, StkId pos) { |
| 96 | int i = L->top-pos; | 96 | int i = L->top-pos; |
| 97 | while (i--) pos[i+1] = pos[i]; | 97 | while (i--) pos[i+1] = pos[i]; |
| 98 | incr_top; | 98 | incr_top; |
| @@ -160,7 +160,7 @@ void luaD_callTM (lua_State *L, const TObject *f, int nParams, int nResults) { | |||
| 160 | ** The arguments are on the stack, right after the function. | 160 | ** The arguments are on the stack, right after the function. |
| 161 | ** When returns, the results are on the stack, starting at the original | 161 | ** When returns, the results are on the stack, starting at the original |
| 162 | ** function position. | 162 | ** function position. |
| 163 | ** The number of results is nResults, unless nResults=MULT_RET. | 163 | ** The number of results is nResults, unless nResults=LUA_MULTRET. |
| 164 | */ | 164 | */ |
| 165 | void luaD_call (lua_State *L, StkId func, int nResults) { | 165 | void luaD_call (lua_State *L, StkId func, int nResults) { |
| 166 | StkId firstResult; | 166 | StkId firstResult; |
| @@ -197,7 +197,7 @@ void luaD_call (lua_State *L, StkId func, int nResults) { | |||
| 197 | if (callhook) /* same hook that was active at entry */ | 197 | if (callhook) /* same hook that was active at entry */ |
| 198 | luaD_callHook(L, func, callhook, "return"); | 198 | luaD_callHook(L, func, callhook, "return"); |
| 199 | /* adjust the number of results */ | 199 | /* adjust the number of results */ |
| 200 | if (nResults == MULT_RET) | 200 | if (nResults == LUA_MULTRET) |
| 201 | nResults = L->top - firstResult; | 201 | nResults = L->top - firstResult; |
| 202 | else | 202 | else |
| 203 | luaD_adjusttop(L, firstResult, nResults); | 203 | luaD_adjusttop(L, firstResult, nResults); |
| @@ -264,7 +264,6 @@ int lua_call (lua_State *L, int nargs, int nresults) { | |||
| 264 | StkId func = L->top - (nargs+1); /* function to be called */ | 264 | StkId func = L->top - (nargs+1); /* function to be called */ |
| 265 | struct lua_longjmp myErrorJmp; | 265 | struct lua_longjmp myErrorJmp; |
| 266 | chain_longjmp(L, &myErrorJmp); | 266 | chain_longjmp(L, &myErrorJmp); |
| 267 | if (nresults == LUA_MULTRET) nresults = MULT_RET; /* internal code */ | ||
| 268 | if (setjmp(myErrorJmp.b) == 0) { | 267 | if (setjmp(myErrorJmp.b) == 0) { |
| 269 | luaD_call(L, func, nresults); | 268 | luaD_call(L, func, nresults); |
| 270 | } | 269 | } |
