From fca0a12e23f964006ce43d35ab86b27c6bbb0a48 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 29 Nov 2001 18:21:46 -0200 Subject: avoid clashing names between macros and fields --- ltable.c | 4 ++-- ltable.h | 8 ++++---- ltests.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ltable.c b/ltable.c index b9e42c18..61a5866d 100644 --- a/ltable.c +++ b/ltable.c @@ -172,8 +172,8 @@ static void numuse (const Table *t, int *narray, int *nhash) { /* count elements in hash part */ i = sizenode(t); while (i--) { - if (ttype(&t->node[i].val) != LUA_TNIL) { - int k = arrayindex(&t->node[i].key); + if (ttype(val(&t->node[i])) != LUA_TNIL) { + int k = arrayindex(key(&t->node[i])); if (k >= 0) /* is `key' an appropriate array index? */ nums[luaO_log2(k-1)+1]++; /* count as such */ totaluse++; diff --git a/ltable.h b/ltable.h index aa41586e..4d0faf55 100644 --- a/ltable.h +++ b/ltable.h @@ -1,5 +1,5 @@ /* -** $Id: ltable.h,v 1.36 2001/08/31 19:46:07 roberto Exp $ +** $Id: ltable.h,v 1.37 2001/10/25 19:14:14 roberto Exp $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -10,9 +10,9 @@ #include "lobject.h" -#define node(_t,_i) (&(_t)->node[_i]) -#define key(_n) (&(_n)->key) -#define val(_n) (&(_n)->val) +#define node(t,i) (&(t)->node[i]) +#define key(n) (&(n)->_key) +#define val(n) (&(n)->_val) #define settableval(p,v) setobj(cast(TObject *, p), v) diff --git a/ltests.c b/ltests.c index 6171af95..e51ff23f 100644 --- a/ltests.c +++ b/ltests.c @@ -277,7 +277,7 @@ static int table_query (lua_State *L) { } else lua_pushstring(L, ""); - luaA_pushobject(L, &t->node[i].val); + luaA_pushobject(L, val(&t->node[i])); if (t->node[i].next) lua_pushnumber(L, t->node[i].next - t->node); else -- cgit v1.2.3-55-g6feb