commit 98816d0ce58db9e817129b076723187d690501df
parent 7482e8f914fbf198af02c2970cf0aadd80740f92
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 28 Feb 2011 14:31:46 -0300
small problems with 'luaone.c'
Diffstat:
5 files changed, 16 insertions(+), 11 deletions(-)
diff --git 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
@@ -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 <float.h>
#include <math.h>
@@ -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
@@ -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
@@ -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
@@ -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);