bugfix: don't use new local var here

This commit is contained in:
Cloud Wu
2015-01-27 18:03:05 +08:00
parent e44f589c53
commit 2de52cee4d

View File

@@ -540,7 +540,7 @@ lindexconf(lua_State *L) {
if (!lua_isinteger(L, 2)) { if (!lua_isinteger(L, 2)) {
return luaL_error(L, "Invalid key %f", lua_tonumber(L, 2)); return luaL_error(L, "Invalid key %f", lua_tonumber(L, 2));
} }
lua_Integer key = lua_tointeger(L, 2); key = (int)lua_tointeger(L, 2);
if (key > 0 && key <= tbl->sizearray) { if (key > 0 && key <= tbl->sizearray) {
--key; --key;
pushvalue(L, tbl->L, tbl->arraytype[key], &tbl->array[key]); pushvalue(L, tbl->L, tbl->arraytype[key], &tbl->array[key]);
@@ -610,7 +610,7 @@ lnextkey(lua_State *L) {
if (!lua_isinteger(L, 2)) { if (!lua_isinteger(L, 2)) {
return 0; return 0;
} }
lua_Integer key = lua_tointeger(L, 2); key = (int)lua_tointeger(L, 2);
if (key > 0 && key <= sizearray) { if (key > 0 && key <= sizearray) {
lua_Integer i; lua_Integer i;
for (i=key;i<sizearray;i++) { for (i=key;i<sizearray;i++) {