From 7bb6385ee34141771aac6e3e6e348c213d92f451 Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 2 Jul 2008 16:35:51 +0000 Subject: Fixing code for the latests mingw32 compilers. --- lib/lua/src/lapi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/lua/src') diff --git a/lib/lua/src/lapi.c b/lib/lua/src/lapi.c index 32421e3..c2c898d 100644 --- a/lib/lua/src/lapi.c +++ b/lib/lua/src/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.8 2008-02-18 10:15:45 pixel Exp $ +** $Id: lapi.c,v 1.9 2008-07-02 16:35:51 pixel Exp $ ** Lua API ** See Copyright Notice in lua.h */ @@ -93,14 +93,15 @@ void luaA_pushobject (lua_State *L, const TValue *o) { LUA_API int lua_checkstack (lua_State *L, int size) { - int res = 1; + int res; lua_lock(L); - if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) + if ((L->top - L->base + size) > LUAI_MAXCSTACK) res = 0; /* stack overflow */ - else if (size > 0) { + else { luaD_checkstack(L, size); if (L->ci->top < L->top + size) L->ci->top = L->top + size; + res = 1; } lua_unlock(L); return res; -- cgit v1.2.3