From f04fe526cd9de3e5460b614b2ff06268ad51872d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 7 Oct 2003 17:13:41 -0300 Subject: new functions `lua_tointeger' and lua_pushinteger' --- ltablib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ltablib.c') diff --git a/ltablib.c b/ltablib.c index 39447e29..601e0df7 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.20 2003/03/11 12:24:34 roberto Exp roberto $ +** $Id: ltablib.c,v 1.21 2003/04/03 13:35:34 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -24,7 +24,7 @@ static int luaB_foreachi (lua_State *L) { luaL_checktype(L, 2, LUA_TFUNCTION); for (i=1; i<=n; i++) { lua_pushvalue(L, 2); /* function */ - lua_pushnumber(L, (lua_Number)i); /* 1st argument */ + lua_pushinteger(L, i); /* 1st argument */ lua_rawgeti(L, 1, i); /* 2nd argument */ lua_call(L, 2, 1); if (!lua_isnil(L, -1)) @@ -54,7 +54,7 @@ static int luaB_foreach (lua_State *L) { static int luaB_getn (lua_State *L) { - lua_pushnumber(L, (lua_Number)aux_getn(L, 1)); + lua_pushinteger(L, aux_getn(L, 1)); return 1; } -- cgit v1.2.3-55-g6feb