aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 82cc71f8..cac980a0 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.132 2003/08/25 19:49:47 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.133 2003/08/27 21:02:08 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -187,8 +187,8 @@ static int luaB_rawset (lua_State *L) {
187 187
188 188
189static int luaB_gcinfo (lua_State *L) { 189static int luaB_gcinfo (lua_State *L) {
190 lua_pushnumber(L, (lua_Number)lua_getgccount(L)); 190 lua_pushinteger(L, lua_getgccount(L));
191 lua_pushnumber(L, (lua_Number)lua_getgcthreshold(L)); 191 lua_pushinteger(L, lua_getgcthreshold(L));
192 return 2; 192 return 2;
193} 193}
194 194
@@ -229,19 +229,19 @@ static int luaB_pairs (lua_State *L) {
229 229
230 230
231static int luaB_ipairs (lua_State *L) { 231static int luaB_ipairs (lua_State *L) {
232 lua_Number i = lua_tonumber(L, 2); 232 int i = (int)lua_tointeger(L, 2);
233 luaL_checktype(L, 1, LUA_TTABLE); 233 luaL_checktype(L, 1, LUA_TTABLE);
234 if (i == 0 && lua_isnone(L, 2)) { /* `for' start? */ 234 if (i == 0 && lua_isnone(L, 2)) { /* `for' start? */
235 lua_pushliteral(L, "ipairs"); 235 lua_pushliteral(L, "ipairs");
236 lua_rawget(L, LUA_GLOBALSINDEX); /* return generator, */ 236 lua_rawget(L, LUA_GLOBALSINDEX); /* return generator, */
237 lua_pushvalue(L, 1); /* state, */ 237 lua_pushvalue(L, 1); /* state, */
238 lua_pushnumber(L, 0); /* and initial value */ 238 lua_pushinteger(L, 0); /* and initial value */
239 return 3; 239 return 3;
240 } 240 }
241 else { /* `for' step */ 241 else { /* `for' step */
242 i++; /* next value */ 242 i++; /* next value */
243 lua_pushnumber(L, i); 243 lua_pushinteger(L, i);
244 lua_rawgeti(L, 1, (int)i); 244 lua_rawgeti(L, 1, i);
245 return (lua_isnil(L, -1)) ? 0 : 2; 245 return (lua_isnil(L, -1)) ? 0 : 2;
246 } 246 }
247} 247}