aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ltable.c b/ltable.c
index 419f9f6c..a8929961 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.129 2017/12/08 17:28:25 roberto Exp roberto $ 2** $Id: ltable.c,v 2.130 2017/12/29 15:58:23 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*/
@@ -116,8 +116,8 @@ static int l_hashfloat (lua_Number n) {
116 return 0; 116 return 0;
117 } 117 }
118 else { /* normal case */ 118 else { /* normal case */
119 unsigned int u = cast(unsigned int, i) + cast(unsigned int, ni); 119 unsigned int u = cast_uint(i) + cast_uint(ni);
120 return cast_int(u <= cast(unsigned int, INT_MAX) ? u : ~u); 120 return cast_int(u <= cast_uint(INT_MAX) ? u : ~u);
121 } 121 }
122} 122}
123#endif 123#endif
@@ -213,7 +213,7 @@ static const TValue *getgeneric (Table *t, const TValue *key) {
213*/ 213*/
214static unsigned int arrayindex (lua_Integer k) { 214static unsigned int arrayindex (lua_Integer k) {
215 if (0 < k && l_castS2U(k) <= MAXASIZE) 215 if (0 < k && l_castS2U(k) <= MAXASIZE)
216 return cast(unsigned int, k); /* 'key' is an appropriate array index */ 216 return cast_uint(k); /* 'key' is an appropriate array index */
217 else 217 else
218 return 0; 218 return 0;
219} 219}
@@ -264,7 +264,7 @@ int luaH_next (lua_State *L, Table *t, StkId key) {
264 264
265static void freehash (lua_State *L, Table *t) { 265static void freehash (lua_State *L, Table *t) {
266 if (!isdummy(t)) 266 if (!isdummy(t))
267 luaM_freearray(L, t->node, cast(size_t, sizenode(t))); 267 luaM_freearray(L, t->node, cast_sizet(sizenode(t)));
268} 268}
269 269
270 270