diff options
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.83 2013/09/11 12:26:14 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.84 2014/01/27 13:34:32 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 | */ |
@@ -443,10 +443,10 @@ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { | |||
443 | /* yes; move colliding node into free position */ | 443 | /* yes; move colliding node into free position */ |
444 | while (othern + gnext(othern) != mp) /* find previous */ | 444 | while (othern + gnext(othern) != mp) /* find previous */ |
445 | othern += gnext(othern); | 445 | othern += gnext(othern); |
446 | gnext(othern) = f - othern; /* re-chain with 'f' in place of 'mp' */ | 446 | gnext(othern) = cast_int(f - othern); /* rechain to point to 'f' */ |
447 | *f = *mp; /* copy colliding node into free pos. (mp->next also goes) */ | 447 | *f = *mp; /* copy colliding node into free pos. (mp->next also goes) */ |
448 | if (gnext(mp) != 0) { | 448 | if (gnext(mp) != 0) { |
449 | gnext(f) += mp - f; /* correct 'next' */ | 449 | gnext(f) += cast_int(mp - f); /* correct 'next' */ |
450 | gnext(mp) = 0; /* now 'mp' is free */ | 450 | gnext(mp) = 0; /* now 'mp' is free */ |
451 | } | 451 | } |
452 | setnilvalue(gval(mp)); | 452 | setnilvalue(gval(mp)); |
@@ -454,9 +454,9 @@ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { | |||
454 | else { /* colliding node is in its own main position */ | 454 | else { /* colliding node is in its own main position */ |
455 | /* new node will go into free position */ | 455 | /* new node will go into free position */ |
456 | if (gnext(mp) != 0) | 456 | if (gnext(mp) != 0) |
457 | gnext(f) = (mp + gnext(mp)) - f; /* chain new position */ | 457 | gnext(f) = cast_int((mp + gnext(mp)) - f); /* chain new position */ |
458 | else lua_assert(gnext(f) == 0); | 458 | else lua_assert(gnext(f) == 0); |
459 | gnext(mp) = f - mp; | 459 | gnext(mp) = cast_int(f - mp); |
460 | mp = f; | 460 | mp = f; |
461 | } | 461 | } |
462 | } | 462 | } |