From 49a67c6d3f608460f3f59da7972022fbe78b5844 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 6 Nov 2009 15:07:12 -0200 Subject: [PATCH] new macro 'NILCONSTANT' to initialize nil constants --- lobject.c | 4 ++-- ltable.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lobject.c b/lobject.c index 88fb0e9e..846d02a7 100644 --- 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 index 9b964156..6c9ccd36 100644 --- 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);