diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-06-09 15:24:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-06-09 15:24:22 -0300 |
commit | f62565abea4e56f6bd064df83e5b0f3818b99d82 (patch) | |
tree | 564d1f29062842a46baae3f4f371f8c15dd74de5 /ltable.c | |
parent | c9d1d9f9c6ce513c048eb85b99936ee241e5cd3b (diff) | |
download | lua-f62565abea4e56f6bd064df83e5b0f3818b99d82.tar.gz lua-f62565abea4e56f6bd064df83e5b0f3818b99d82.tar.bz2 lua-f62565abea4e56f6bd064df83e5b0f3818b99d82.zip |
avoid warnings with -Wstrict-overflow
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 | } |