From e2b15aa21d2f31ccc93e35f50928e26a8d9c84ce Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 28 Jan 2018 13:13:26 -0200 Subject: janitor work on casts --- ltable.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index 419f9f6c..a8929961 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.129 2017/12/08 17:28:25 roberto Exp roberto $ +** $Id: ltable.c,v 2.130 2017/12/29 15:58:23 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -116,8 +116,8 @@ static int l_hashfloat (lua_Number n) { return 0; } else { /* normal case */ - unsigned int u = cast(unsigned int, i) + cast(unsigned int, ni); - return cast_int(u <= cast(unsigned int, INT_MAX) ? u : ~u); + unsigned int u = cast_uint(i) + cast_uint(ni); + return cast_int(u <= cast_uint(INT_MAX) ? u : ~u); } } #endif @@ -213,7 +213,7 @@ static const TValue *getgeneric (Table *t, const TValue *key) { */ static unsigned int arrayindex (lua_Integer k) { if (0 < k && l_castS2U(k) <= MAXASIZE) - return cast(unsigned int, k); /* 'key' is an appropriate array index */ + return cast_uint(k); /* 'key' is an appropriate array index */ else return 0; } @@ -264,7 +264,7 @@ int luaH_next (lua_State *L, Table *t, StkId key) { static void freehash (lua_State *L, Table *t) { if (!isdummy(t)) - luaM_freearray(L, t->node, cast(size_t, sizenode(t))); + luaM_freearray(L, t->node, cast_sizet(sizenode(t))); } -- cgit v1.2.3-55-g6feb