diff options
Diffstat (limited to 'src/3rdParty/lua/lstate.c')
-rw-r--r-- | src/3rdParty/lua/lstate.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/3rdParty/lua/lstate.c b/src/3rdParty/lua/lstate.c index 1fbefb4..7fefacb 100644 --- a/src/3rdParty/lua/lstate.c +++ b/src/3rdParty/lua/lstate.c | |||
@@ -119,7 +119,7 @@ CallInfo *luaE_extendCI (lua_State *L) { | |||
119 | /* | 119 | /* |
120 | ** free all CallInfo structures not in use by a thread | 120 | ** free all CallInfo structures not in use by a thread |
121 | */ | 121 | */ |
122 | void luaE_freeCI (lua_State *L) { | 122 | static void freeCI (lua_State *L) { |
123 | CallInfo *ci = L->ci; | 123 | CallInfo *ci = L->ci; |
124 | CallInfo *next = ci->next; | 124 | CallInfo *next = ci->next; |
125 | ci->next = NULL; | 125 | ci->next = NULL; |
@@ -204,7 +204,7 @@ static void freestack (lua_State *L) { | |||
204 | if (L->stack.p == NULL) | 204 | if (L->stack.p == NULL) |
205 | return; /* stack not completely built yet */ | 205 | return; /* stack not completely built yet */ |
206 | L->ci = &L->base_ci; /* free the entire 'ci' list */ | 206 | L->ci = &L->base_ci; /* free the entire 'ci' list */ |
207 | luaE_freeCI(L); | 207 | freeCI(L); |
208 | lua_assert(L->nci == 0); | 208 | lua_assert(L->nci == 0); |
209 | luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK); /* free stack */ | 209 | luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK); /* free stack */ |
210 | } | 210 | } |
@@ -339,7 +339,7 @@ int luaE_resetthread (lua_State *L, int status) { | |||
339 | } | 339 | } |
340 | 340 | ||
341 | 341 | ||
342 | LUA_API int lua_resetthread (lua_State *L, lua_State *from) { | 342 | LUA_API int lua_closethread (lua_State *L, lua_State *from) { |
343 | int status; | 343 | int status; |
344 | lua_lock(L); | 344 | lua_lock(L); |
345 | L->nCcalls = (from) ? getCcalls(from) : 0; | 345 | L->nCcalls = (from) ? getCcalls(from) : 0; |
@@ -349,6 +349,14 @@ LUA_API int lua_resetthread (lua_State *L, lua_State *from) { | |||
349 | } | 349 | } |
350 | 350 | ||
351 | 351 | ||
352 | /* | ||
353 | ** Deprecated! Use 'lua_closethread' instead. | ||
354 | */ | ||
355 | LUA_API int lua_resetthread (lua_State *L) { | ||
356 | return lua_closethread(L, NULL); | ||
357 | } | ||
358 | |||
359 | |||
352 | LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | 360 | LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { |
353 | int i; | 361 | int i; |
354 | lua_State *L; | 362 | lua_State *L; |
@@ -425,7 +433,7 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) { | |||
425 | void luaE_warnerror (lua_State *L, const char *where) { | 433 | void luaE_warnerror (lua_State *L, const char *where) { |
426 | TValue *errobj = s2v(L->top.p - 1); /* error object */ | 434 | TValue *errobj = s2v(L->top.p - 1); /* error object */ |
427 | const char *msg = (ttisstring(errobj)) | 435 | const char *msg = (ttisstring(errobj)) |
428 | ? svalue(errobj) | 436 | ? getstr(tsvalue(errobj)) |
429 | : "error object is not a string"; | 437 | : "error object is not a string"; |
430 | /* produce warning "error in %s (%s)" (where, msg) */ | 438 | /* produce warning "error in %s (%s)" (where, msg) */ |
431 | luaE_warning(L, "error in ", 1); | 439 | luaE_warning(L, "error in ", 1); |