From 8f961da3dbf8c45389d1431e6dff8e44e41f1a57 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 15 Apr 2014 11:29:30 -0300 Subject: macros cast_integer/cast_unsigned replaced by cast_u2s/cast_s2u, that should be used only between lua_Integer and lua_Unsigned --- ltable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index 3d4f3c38..520ba98c 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.85 2014/04/01 14:39:55 roberto Exp roberto $ +** $Id: ltable.c,v 2.86 2014/04/13 21:11:19 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -472,7 +472,7 @@ TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { */ const TValue *luaH_getint (Table *t, lua_Integer key) { /* (1 <= key && key <= t->sizearray) */ - if (cast_unsigned(key - 1) < cast_unsigned(t->sizearray)) + if (cast_s2u(key - 1) < cast(unsigned int, t->sizearray)) return &t->array[key - 1]; else { Node *n = hashint(t, key); -- cgit v1.2.3-55-g6feb