diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-06-01 14:40:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-06-01 14:40:38 -0300 |
commit | 505fc9122255b8a2ef761720bca21fd5e9be8e73 (patch) | |
tree | cf3fe8068546547e7f53e86e16a32ee923a4c514 /lapi.c | |
parent | fb8fa661366e15e98c60d8929feaab9e551a02f9 (diff) | |
download | lua-505fc9122255b8a2ef761720bca21fd5e9be8e73.tar.gz lua-505fc9122255b8a2ef761720bca21fd5e9be8e73.tar.bz2 lua-505fc9122255b8a2ef761720bca21fd5e9be8e73.zip |
no more 'luaO_nilobject' to avoid comparison of global variable addresses
(now uses static variables)
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.290 2018/02/27 20:01:55 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.291 2018/04/04 14:23:41 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -38,10 +38,12 @@ const char lua_ident[] = | |||
38 | 38 | ||
39 | 39 | ||
40 | /* value at a non-valid index */ | 40 | /* value at a non-valid index */ |
41 | #define NONVALIDVALUE cast(TValue *, luaO_nilobject) | 41 | |
42 | static const TValue nonvalidvaluep = {NILCONSTANT}; | ||
43 | #define NONVALIDVALUE cast(TValue *, &nonvalidvaluep) | ||
42 | 44 | ||
43 | /* corresponding test */ | 45 | /* corresponding test */ |
44 | #define isvalid(o) ((o) != luaO_nilobject) | 46 | #define isvalid(o) ((o) != &nonvalidvaluep) |
45 | 47 | ||
46 | /* test for pseudo index */ | 48 | /* test for pseudo index */ |
47 | #define ispseudo(i) ((i) <= LUA_REGISTRYINDEX) | 49 | #define ispseudo(i) ((i) <= LUA_REGISTRYINDEX) |