commit fca0a12e23f964006ce43d35ab86b27c6bbb0a48
parent 72659a06050632da1a9b4c492302be46ac283f6b
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Thu, 29 Nov 2001 18:21:24 -0200
avoid clashing names between macros and fields
Diffstat:
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git 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
@@ -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
@@ -277,7 +277,7 @@ static int table_query (lua_State *L) {
}
else
lua_pushstring(L, "<undef>");
- 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