diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-06 15:07:12 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-11-06 15:07:12 -0200 |
| commit | 49a67c6d3f608460f3f59da7972022fbe78b5844 (patch) | |
| tree | 915e14e5bda89268a749679c072548f927ef159b | |
| parent | a921d81033555e1c122834f0cd19bd8a17ac35c0 (diff) | |
| download | lua-49a67c6d3f608460f3f59da7972022fbe78b5844.tar.gz lua-49a67c6d3f608460f3f59da7972022fbe78b5844.tar.bz2 lua-49a67c6d3f608460f3f59da7972022fbe78b5844.zip | |
new macro 'NILCONSTANT' to initialize nil constants
| -rw-r--r-- | lobject.c | 4 | ||||
| -rw-r--r-- | ltable.c | 8 |
2 files changed, 6 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.30 2009/05/27 17:11:27 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.31 2009/06/17 17:48:34 roberto Exp roberto $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | 27 | ||
| 28 | const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; | 28 | const TValue luaO_nilobject_ = {NILCONSTANT}; |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 2.42 2009/10/23 12:31:12 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.43 2009/11/05 17:43:54 roberto Exp roberto $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -72,8 +72,8 @@ | |||
| 72 | #define dummynode (&dummynode_) | 72 | #define dummynode (&dummynode_) |
| 73 | 73 | ||
| 74 | static const Node dummynode_ = { | 74 | static const Node dummynode_ = { |
| 75 | {{NULL}, LUA_TNIL}, /* value */ | 75 | {NILCONSTANT}, /* value */ |
| 76 | {{{NULL}, LUA_TNIL, NULL}} /* key */ | 76 | {{NILCONSTANT, NULL}} /* key */ |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | 79 | ||
| @@ -418,7 +418,7 @@ static TValue *newkey (lua_State *L, Table *t, const TValue *key) { | |||
| 418 | mp = n; | 418 | mp = n; |
| 419 | } | 419 | } |
| 420 | } | 420 | } |
| 421 | setnodekey(mp, key); | 421 | setobj2t(L, gkey(mp), key); |
| 422 | luaC_barriert(L, t, key); | 422 | luaC_barriert(L, t, key); |
| 423 | lua_assert(ttisnil(gval(mp))); | 423 | lua_assert(ttisnil(gval(mp))); |
| 424 | return gval(mp); | 424 | return gval(mp); |
