From 97378326412b8e39ff2e0b839d5fad085dbc57ea Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 4 Apr 2014 13:38:11 -0300 Subject: 'int' -> 'lua_Integer' in several functions --- ltablib.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ltablib.c b/ltablib.c index 9160b94d..f20bc026 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.66 2014/03/21 13:52:33 roberto Exp roberto $ +** $Id: ltablib.c,v 1.67 2014/04/01 18:50:34 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -40,16 +40,16 @@ static int maxn (lua_State *L) { static int tinsert (lua_State *L) { - int e = aux_getn(L, 1) + 1; /* first empty element */ - int pos; /* where to insert new element */ + lua_Integer e = aux_getn(L, 1) + 1; /* first empty element */ + lua_Integer pos; /* where to insert new element */ switch (lua_gettop(L)) { case 2: { /* called with only 2 arguments */ pos = e; /* insert new element at the end */ break; } case 3: { - int i; - pos = luaL_checkint(L, 2); /* 2nd argument is the position */ + lua_Integer i; + pos = luaL_checkinteger(L, 2); /* 2nd argument is the position */ luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds"); for (i = e; i > pos; i--) { /* move up elements */ lua_rawgeti(L, 1, i-1); @@ -67,8 +67,8 @@ static int tinsert (lua_State *L) { static int tremove (lua_State *L) { - int size = aux_getn(L, 1); - int pos = luaL_optint(L, 2, size); + lua_Integer size = aux_getn(L, 1); + lua_Integer pos = luaL_optinteger(L, 2, size); if (pos != size) /* validate 'pos' if given */ luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds"); lua_rawgeti(L, 1, pos); /* result = t[pos] */ @@ -82,7 +82,7 @@ static int tremove (lua_State *L) { } -static void addfield (lua_State *L, luaL_Buffer *b, int i) { +static void addfield (lua_State *L, luaL_Buffer *b, lua_Integer i) { lua_rawgeti(L, 1, i); if (!lua_isstring(L, -1)) luaL_error(L, "invalid value (%s) at index %d in table for " @@ -94,11 +94,11 @@ static void addfield (lua_State *L, luaL_Buffer *b, int i) { static int tconcat (lua_State *L) { luaL_Buffer b; size_t lsep; - int i, last; + lua_Integer i, last; const char *sep = luaL_optlstring(L, 2, "", &lsep); luaL_checktype(L, 1, LUA_TTABLE); - i = luaL_optint(L, 3, 1); - last = luaL_opt(L, luaL_checkint, 4, luaL_len(L, 1)); + i = luaL_optinteger(L, 3, 1); + last = luaL_opt(L, luaL_checkinteger, 4, luaL_len(L, 1)); luaL_buffinit(L, &b); for (; i < last; i++) { addfield(L, &b, i); -- cgit v1.2.3-55-g6feb