no more 'luaH_emptyobject' and comparisons of addresses of global variables

(instead, use a different kind of nil to signal the fake entry returned
when a key is not found in a table)
This commit is contained in:
Roberto Ierusalimschy
2018-06-01 13:51:34 -03:00
parent b397064955
commit fb8fa66136
5 changed files with 47 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltable.h,v 2.25 2017/06/09 16:48:44 roberto Exp roberto $
** $Id: ltable.h,v 2.26 2018/02/23 13:13:31 roberto Exp roberto $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -21,8 +21,6 @@
/* true when 't' is using 'dummynode' as its hash part */
#define isdummy(t) ((t)->lastfree == NULL)
#define luaH_emptyobject (&luaH_emptyobject_)
/* allocated size for hash nodes */
#define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t))
@@ -32,9 +30,6 @@
#define nodefromval(v) cast(Node *, (v))
LUAI_DDEC const TValue luaH_emptyobject_;
LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);
LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
TValue *value);