diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lua/ltable.h (renamed from src/lua-5.3/ltable.h) | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/lua-5.3/ltable.h b/src/lua/ltable.h index 92db0ac..ebd7f8e 100644 --- a/src/lua-5.3/ltable.h +++ b/src/lua/ltable.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.h,v 2.23.1.2 2018/05/24 19:39:05 roberto Exp $ | 2 | ** $Id: ltable.h $ |
| 3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -12,18 +12,9 @@ | |||
| 12 | 12 | ||
| 13 | #define gnode(t,i) (&(t)->node[i]) | 13 | #define gnode(t,i) (&(t)->node[i]) |
| 14 | #define gval(n) (&(n)->i_val) | 14 | #define gval(n) (&(n)->i_val) |
| 15 | #define gnext(n) ((n)->i_key.nk.next) | 15 | #define gnext(n) ((n)->u.next) |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | /* 'const' to avoid wrong writings that can mess up field 'next' */ | ||
| 19 | #define gkey(n) cast(const TValue*, (&(n)->i_key.tvk)) | ||
| 20 | |||
| 21 | /* | ||
| 22 | ** writable version of 'gkey'; allows updates to individual fields, | ||
| 23 | ** but not to the whole (which has incompatible type) | ||
| 24 | */ | ||
| 25 | #define wgkey(n) (&(n)->i_key.nk) | ||
| 26 | |||
| 27 | #define invalidateTMcache(t) ((t)->flags = 0) | 18 | #define invalidateTMcache(t) ((t)->flags = 0) |
| 28 | 19 | ||
| 29 | 20 | ||
| @@ -35,9 +26,8 @@ | |||
| 35 | #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t)) | 26 | #define allocsizenode(t) (isdummy(t) ? 0 : sizenode(t)) |
| 36 | 27 | ||
| 37 | 28 | ||
| 38 | /* returns the key, given the value of a table entry */ | 29 | /* returns the Node, given the value of a table entry */ |
| 39 | #define keyfromval(v) \ | 30 | #define nodefromval(v) cast(Node *, (v)) |
| 40 | (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val)))) | ||
| 41 | 31 | ||
| 42 | 32 | ||
| 43 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); | 33 | LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); |
| @@ -55,6 +45,7 @@ LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); | |||
| 55 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); | 45 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); |
| 56 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); | 46 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); |
| 57 | LUAI_FUNC lua_Unsigned luaH_getn (Table *t); | 47 | LUAI_FUNC lua_Unsigned luaH_getn (Table *t); |
| 48 | LUAI_FUNC unsigned int luaH_realasize (const Table *t); | ||
| 58 | 49 | ||
| 59 | 50 | ||
| 60 | #if defined(LUA_DEBUG) | 51 | #if defined(LUA_DEBUG) |
