From d5fd44d747e9efce5875a0d08f6484f4187838bd Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 3 May 2005 16:30:17 -0300 Subject: corrected definition of lua_number2int for Windows --- ltable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index ab69c343..7b51da46 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 2.19 2005/03/16 16:58:41 roberto Exp roberto $ +** $Id: ltable.c,v 2.20 2005/04/01 13:51:37 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -469,7 +469,8 @@ const TValue *luaH_get (Table *t, const TValue *key) { case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); case LUA_TNUMBER: { int k; - lua_number2int(k, (nvalue(key))); + lua_Number n = nvalue(key); + lua_number2int(k, n); if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ return luaH_getnum(t, k); /* use specialized version */ /* else go through */ -- cgit v1.2.3-55-g6feb