aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-06-09 15:24:22 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-06-09 15:24:22 -0300
commitf62565abea4e56f6bd064df83e5b0f3818b99d82 (patch)
tree564d1f29062842a46baae3f4f371f8c15dd74de5 /ltable.c
parentc9d1d9f9c6ce513c048eb85b99936ee241e5cd3b (diff)
downloadlua-f62565abea4e56f6bd064df83e5b0f3818b99d82.tar.gz
lua-f62565abea4e56f6bd064df83e5b0f3818b99d82.tar.bz2
lua-f62565abea4e56f6bd064df83e5b0f3818b99d82.zip
avoid warnings with -Wstrict-overflow
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ltable.c b/ltable.c
index e4ff8dd5..315fc61e 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.57 2011/05/31 18:27:56 roberto Exp roberto $ 2** $Id: ltable.c,v 2.58 2011/06/02 19:31:40 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*/
@@ -88,8 +88,9 @@ static Node *hashnum (const Table *t, lua_Number n) {
88 int i; 88 int i;
89 luai_hashnum(i, n); 89 luai_hashnum(i, n);
90 if (i < 0) { 90 if (i < 0) {
91 i = -i; /* must be a positive value */ 91 if ((unsigned int)i == -(unsigned int)i)
92 if (i < 0) i = 0; /* handle INT_MIN */ 92 i = 0; /* handle INT_MIN */
93 i = -i; /* must be a positive value */
93 } 94 }
94 return hashmod(t, i); 95 return hashmod(t, i);
95} 96}