diff options
author | Li Jin <dragon-fly@qq.com> | 2023-08-24 09:21:38 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-08-24 09:21:38 +0800 |
commit | cfcea12ba0e6a40d7c04ac64c75563db0896985c (patch) | |
tree | 8ee7c6d9cd5f7b60fd9bda035b703cc9969ab678 /src/3rdParty/lua/ltable.c | |
parent | eb48c686a7ab5bd3f3f3a8628ed0423872a932c6 (diff) | |
download | yuescript-cfcea12ba0e6a40d7c04ac64c75563db0896985c.tar.gz yuescript-cfcea12ba0e6a40d7c04ac64c75563db0896985c.tar.bz2 yuescript-cfcea12ba0e6a40d7c04ac64c75563db0896985c.zip |
update Lua 5.4.
Diffstat (limited to 'src/3rdParty/lua/ltable.c')
-rw-r--r-- | src/3rdParty/lua/ltable.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/3rdParty/lua/ltable.c b/src/3rdParty/lua/ltable.c index cc7993e..3fb575a 100644 --- a/src/3rdParty/lua/ltable.c +++ b/src/3rdParty/lua/ltable.c | |||
@@ -257,10 +257,12 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) { | |||
257 | size |= (size >> 2); | 257 | size |= (size >> 2); |
258 | size |= (size >> 4); | 258 | size |= (size >> 4); |
259 | size |= (size >> 8); | 259 | size |= (size >> 8); |
260 | #if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */ | ||
260 | size |= (size >> 16); | 261 | size |= (size >> 16); |
261 | #if (UINT_MAX >> 30) > 3 | 262 | #if (UINT_MAX >> 30) > 3 |
262 | size |= (size >> 32); /* unsigned int has more than 32 bits */ | 263 | size |= (size >> 32); /* unsigned int has more than 32 bits */ |
263 | #endif | 264 | #endif |
265 | #endif | ||
264 | size++; | 266 | size++; |
265 | lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); | 267 | lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); |
266 | return size; | 268 | return size; |
@@ -660,7 +662,8 @@ static Node *getfreepos (Table *t) { | |||
660 | ** put new key in its main position; otherwise (colliding node is in its main | 662 | ** put new key in its main position; otherwise (colliding node is in its main |
661 | ** position), new key goes to an empty position. | 663 | ** position), new key goes to an empty position. |
662 | */ | 664 | */ |
663 | void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { | 665 | static void luaH_newkey (lua_State *L, Table *t, const TValue *key, |
666 | TValue *value) { | ||
664 | Node *mp; | 667 | Node *mp; |
665 | TValue aux; | 668 | TValue aux; |
666 | if (l_unlikely(ttisnil(key))) | 669 | if (l_unlikely(ttisnil(key))) |