From 98816d0ce58db9e817129b076723187d690501df Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 28 Feb 2011 14:32:10 -0300 Subject: small problems with 'luaone.c' --- lbaselib.c | 4 ++-- llimits.h | 6 +++--- lobject.h | 7 ++++++- ltm.c | 6 +++--- ltm.h | 4 ++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lbaselib.c b/lbaselib.c index 64a609fd..67edd96e 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.258 2011/01/07 12:41:48 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.259 2011/01/26 16:30:02 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -395,7 +395,7 @@ static int luaB_select (lua_State *L) { static int pcallcont (lua_State *L) { - int errfunc; /* call has an error function in bottom of the stack */ + int errfunc = 0; /* =0 to avoid warnings */ int status = lua_getctx(L, &errfunc); lua_assert(status != LUA_OK); lua_pushboolean(L, (status == LUA_YIELD)); /* first result (status) */ diff --git a/llimits.h b/llimits.h index 02b10fe4..72f32a8d 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.86 2010/12/23 15:38:28 roberto Exp roberto $ +** $Id: llimits.h,v 1.87 2011/02/01 16:52:38 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -250,7 +250,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; }; -#if defined(ltable_c) && !defined(luai_hashnum) /* { */ +#if (defined(ltable_c) || defined(luaall_c)) && !defined(luai_hashnum) #include #include @@ -259,7 +259,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; }; n = frexp(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \ lua_number2int(i, n); i += e; } -#endif /* } */ +#endif diff --git a/lobject.h b/lobject.h index ac4bf306..280e4b2c 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.45 2010/12/10 14:53:15 roberto Exp roberto $ +** $Id: lobject.h,v 2.46 2011/01/07 15:46:27 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -23,6 +23,11 @@ #define LUA_TUPVAL (LUA_NUMTAGS+1) #define LUA_TDEADKEY (LUA_NUMTAGS+2) +/* +** number of all possible tags (including LUA_TNONE but excluding DEADKEY) +*/ +#define LUA_TOTALTAGS (LUA_TUPVAL+2) + /* ** Variant tag for light C functions (negative to be considered diff --git a/ltm.c b/ltm.c index 1d1e5d1a..e411606d 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 2.11 2010/01/13 16:18:25 roberto Exp roberto $ +** $Id: ltm.c,v 2.12 2010/04/13 20:48:12 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -21,11 +21,11 @@ static const char udatatypename[] = "userdata"; -LUAI_DDEF const char *const luaT_typenames_[] = { +LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = { "no value", "nil", "boolean", udatatypename, "number", "string", "table", "function", udatatypename, "thread", - "proto", "upval" + "proto", "upval" /* these last two cases are used for tests only */ }; diff --git a/ltm.h b/ltm.h index be079b30..dfd74eff 100644 --- a/ltm.h +++ b/ltm.h @@ -1,5 +1,5 @@ /* -** $Id: ltm.h,v 2.9 2010/01/13 16:18:25 roberto Exp roberto $ +** $Id: ltm.h,v 2.10 2010/04/13 20:48:12 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -46,7 +46,7 @@ typedef enum { #define ttypename(x) luaT_typenames_[(x) + 1] #define objtypename(x) ttypename(ttypenv(x)) -LUAI_DDEC const char *const luaT_typenames_[]; +LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); -- cgit v1.2.3-55-g6feb