commit 49a67c6d3f608460f3f59da7972022fbe78b5844
parent a921d81033555e1c122834f0cd19bd8a17ac35c0
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 6 Nov 2009 15:06:48 -0200
new macro 'NILCONSTANT' to initialize nil constants
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lobject.c b/lobject.c
@@ -1,5 +1,5 @@
/*
-** $Id: lobject.c,v 2.30 2009/05/27 17:11:27 roberto Exp roberto $
+** $Id: lobject.c,v 2.31 2009/06/17 17:48:34 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@@ -25,7 +25,7 @@
-const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL};
+const TValue luaO_nilobject_ = {NILCONSTANT};
/*
diff --git a/ltable.c b/ltable.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.c,v 2.42 2009/10/23 12:31:12 roberto Exp roberto $
+** $Id: ltable.c,v 2.43 2009/11/05 17:43:54 roberto Exp roberto $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -72,8 +72,8 @@
#define dummynode (&dummynode_)
static const Node dummynode_ = {
- {{NULL}, LUA_TNIL}, /* value */
- {{{NULL}, LUA_TNIL, NULL}} /* key */
+ {NILCONSTANT}, /* value */
+ {{NILCONSTANT, NULL}} /* key */
};
@@ -418,7 +418,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
mp = n;
}
}
- setnodekey(mp, key);
+ setobj2t(L, gkey(mp), key);
luaC_barriert(L, t, key);
lua_assert(ttisnil(gval(mp)));
return gval(mp);