aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-02-28 14:32:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-02-28 14:32:10 -0300
commit98816d0ce58db9e817129b076723187d690501df (patch)
treeb8cab039ba8aecb51453206447890c05cb618b34
parent7482e8f914fbf198af02c2970cf0aadd80740f92 (diff)
downloadlua-98816d0ce58db9e817129b076723187d690501df.tar.gz
lua-98816d0ce58db9e817129b076723187d690501df.tar.bz2
lua-98816d0ce58db9e817129b076723187d690501df.zip
small problems with 'luaone.c'
-rw-r--r--lbaselib.c4
-rw-r--r--llimits.h6
-rw-r--r--lobject.h7
-rw-r--r--ltm.c6
-rw-r--r--ltm.h4
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 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.258 2011/01/07 12:41:48 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.259 2011/01/26 16:30:02 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -395,7 +395,7 @@ static int luaB_select (lua_State *L) {
395 395
396 396
397static int pcallcont (lua_State *L) { 397static int pcallcont (lua_State *L) {
398 int errfunc; /* call has an error function in bottom of the stack */ 398 int errfunc = 0; /* =0 to avoid warnings */
399 int status = lua_getctx(L, &errfunc); 399 int status = lua_getctx(L, &errfunc);
400 lua_assert(status != LUA_OK); 400 lua_assert(status != LUA_OK);
401 lua_pushboolean(L, (status == LUA_YIELD)); /* first result (status) */ 401 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 @@
1/* 1/*
2** $Id: llimits.h,v 1.86 2010/12/23 15:38:28 roberto Exp roberto $ 2** $Id: llimits.h,v 1.87 2011/02/01 16:52:38 roberto Exp roberto $
3** Limits, basic types, and some other `installation-dependent' definitions 3** Limits, basic types, and some other `installation-dependent' definitions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -250,7 +250,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; };
250 250
251 251
252 252
253#if defined(ltable_c) && !defined(luai_hashnum) /* { */ 253#if (defined(ltable_c) || defined(luaall_c)) && !defined(luai_hashnum)
254 254
255#include <float.h> 255#include <float.h>
256#include <math.h> 256#include <math.h>
@@ -259,7 +259,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; };
259 n = frexp(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \ 259 n = frexp(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \
260 lua_number2int(i, n); i += e; } 260 lua_number2int(i, n); i += e; }
261 261
262#endif /* } */ 262#endif
263 263
264 264
265 265
diff --git a/lobject.h b/lobject.h
index ac4bf306..280e4b2c 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.45 2010/12/10 14:53:15 roberto Exp roberto $ 2** $Id: lobject.h,v 2.46 2011/01/07 15:46:27 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -23,6 +23,11 @@
23#define LUA_TUPVAL (LUA_NUMTAGS+1) 23#define LUA_TUPVAL (LUA_NUMTAGS+1)
24#define LUA_TDEADKEY (LUA_NUMTAGS+2) 24#define LUA_TDEADKEY (LUA_NUMTAGS+2)
25 25
26/*
27** number of all possible tags (including LUA_TNONE but excluding DEADKEY)
28*/
29#define LUA_TOTALTAGS (LUA_TUPVAL+2)
30
26 31
27/* 32/*
28** Variant tag for light C functions (negative to be considered 33** 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 @@
1/* 1/*
2** $Id: ltm.c,v 2.11 2010/01/13 16:18:25 roberto Exp roberto $ 2** $Id: ltm.c,v 2.12 2010/04/13 20:48:12 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -21,11 +21,11 @@
21 21
22static const char udatatypename[] = "userdata"; 22static const char udatatypename[] = "userdata";
23 23
24LUAI_DDEF const char *const luaT_typenames_[] = { 24LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = {
25 "no value", 25 "no value",
26 "nil", "boolean", udatatypename, "number", 26 "nil", "boolean", udatatypename, "number",
27 "string", "table", "function", udatatypename, "thread", 27 "string", "table", "function", udatatypename, "thread",
28 "proto", "upval" 28 "proto", "upval" /* these last two cases are used for tests only */
29}; 29};
30 30
31 31
diff --git a/ltm.h b/ltm.h
index be079b30..dfd74eff 100644
--- a/ltm.h
+++ b/ltm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.h,v 2.9 2010/01/13 16:18:25 roberto Exp roberto $ 2** $Id: ltm.h,v 2.10 2010/04/13 20:48:12 roberto Exp roberto $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -46,7 +46,7 @@ typedef enum {
46#define ttypename(x) luaT_typenames_[(x) + 1] 46#define ttypename(x) luaT_typenames_[(x) + 1]
47#define objtypename(x) ttypename(ttypenv(x)) 47#define objtypename(x) ttypename(ttypenv(x))
48 48
49LUAI_DDEC const char *const luaT_typenames_[]; 49LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS];
50 50
51 51
52LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 52LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);