avoid the identifier index' (clashes with BSD index' function)

This commit is contained in:
Roberto Ierusalimschy
2003-02-27 09:33:07 -03:00
parent 59ce42dbd5
commit e1a424e8a3
4 changed files with 98 additions and 98 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 1.152 2003/02/10 17:31:13 roberto Exp roberto $
** $Id: ltests.c,v 1.153 2003/02/18 16:02:56 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -41,7 +41,7 @@ static lua_State *lua_state = NULL;
int islocked = 0;
#define index(L,k) (L->ci->base+(k) - 1)
#define func_at(L,k) (L->ci->base+(k) - 1)
static void setnameval (lua_State *L, const char *name, int val) {
@@ -190,7 +190,7 @@ static int listcode (lua_State *L) {
Proto *p;
luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1),
1, "Lua function expected");
p = clvalue(index(L, 1))->l.p;
p = clvalue(func_at(L, 1))->l.p;
lua_newtable(L);
setnameval(L, "maxstack", p->maxstacksize);
setnameval(L, "numparams", p->numparams);
@@ -209,7 +209,7 @@ static int listk (lua_State *L) {
int i;
luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1),
1, "Lua function expected");
p = clvalue(index(L, 1))->l.p;
p = clvalue(func_at(L, 1))->l.p;
lua_newtable(L);
for (i=0; i<p->sizek; i++) {
lua_pushnumber(L, i+1);
@@ -227,7 +227,7 @@ static int listlocals (lua_State *L) {
const char *name;
luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1),
1, "Lua function expected");
p = clvalue(index(L, 1))->l.p;
p = clvalue(func_at(L, 1))->l.p;
while ((name = luaF_getlocalname(p, ++i, pc)) != NULL)
lua_pushstring(L, name);
return i-1;
@@ -267,13 +267,13 @@ static int mem_query (lua_State *L) {
static int hash_query (lua_State *L) {
if (lua_isnone(L, 2)) {
luaL_argcheck(L, lua_type(L, 1) == LUA_TSTRING, 1, "string expected");
lua_pushnumber(L, tsvalue(index(L, 1))->tsv.hash);
lua_pushnumber(L, tsvalue(func_at(L, 1))->tsv.hash);
}
else {
TObject *o = index(L, 1);
TObject *o = func_at(L, 1);
Table *t;
luaL_checktype(L, 2, LUA_TTABLE);
t = hvalue(index(L, 2));
t = hvalue(func_at(L, 2));
lua_pushnumber(L, luaH_mainposition(t, o) - t->node);
}
return 1;
@@ -295,7 +295,7 @@ static int table_query (lua_State *L) {
const Table *t;
int i = luaL_optint(L, 2, -1);
luaL_checktype(L, 1, LUA_TTABLE);
t = hvalue(index(L, 1));
t = hvalue(func_at(L, 1));
if (i == -1) {
lua_pushnumber(L, t->sizearray);
lua_pushnumber(L, sizenode(t));