diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-03 16:30:17 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-03 16:30:17 -0300 |
commit | d5fd44d747e9efce5875a0d08f6484f4187838bd (patch) | |
tree | 17b9251d4ece07ef07e4c34a867de135a9394aef /ltable.c | |
parent | b0abc2ca03556a4483750c2c2389bd413710e36f (diff) | |
download | lua-d5fd44d747e9efce5875a0d08f6484f4187838bd.tar.gz lua-d5fd44d747e9efce5875a0d08f6484f4187838bd.tar.bz2 lua-d5fd44d747e9efce5875a0d08f6484f4187838bd.zip |
corrected definition of lua_number2int for Windows
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.19 2005/03/16 16:58:41 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.20 2005/04/01 13:51:37 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 | */ |
@@ -469,7 +469,8 @@ const TValue *luaH_get (Table *t, const TValue *key) { | |||
469 | case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); | 469 | case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); |
470 | case LUA_TNUMBER: { | 470 | case LUA_TNUMBER: { |
471 | int k; | 471 | int k; |
472 | lua_number2int(k, (nvalue(key))); | 472 | lua_Number n = nvalue(key); |
473 | lua_number2int(k, n); | ||
473 | if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ | 474 | if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ |
474 | return luaH_getnum(t, k); /* use specialized version */ | 475 | return luaH_getnum(t, k); /* use specialized version */ |
475 | /* else go through */ | 476 | /* else go through */ |