aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-11-29 18:21:46 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-11-29 18:21:46 -0200
commitfca0a12e23f964006ce43d35ab86b27c6bbb0a48 (patch)
tree7c57492d6ae7d2b2178906e1968295b3ec83eb9f
parent72659a06050632da1a9b4c492302be46ac283f6b (diff)
downloadlua-fca0a12e23f964006ce43d35ab86b27c6bbb0a48.tar.gz
lua-fca0a12e23f964006ce43d35ab86b27c6bbb0a48.tar.bz2
lua-fca0a12e23f964006ce43d35ab86b27c6bbb0a48.zip
avoid clashing names between macros and fields
-rw-r--r--ltable.c4
-rw-r--r--ltable.h8
-rw-r--r--ltests.c2
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) {
172 /* count elements in hash part */ 172 /* count elements in hash part */
173 i = sizenode(t); 173 i = sizenode(t);
174 while (i--) { 174 while (i--) {
175 if (ttype(&t->node[i].val) != LUA_TNIL) { 175 if (ttype(val(&t->node[i])) != LUA_TNIL) {
176 int k = arrayindex(&t->node[i].key); 176 int k = arrayindex(key(&t->node[i]));
177 if (k >= 0) /* is `key' an appropriate array index? */ 177 if (k >= 0) /* is `key' an appropriate array index? */
178 nums[luaO_log2(k-1)+1]++; /* count as such */ 178 nums[luaO_log2(k-1)+1]++; /* count as such */
179 totaluse++; 179 totaluse++;
diff --git a/ltable.h b/ltable.h
index aa41586e..4d0faf55 100644
--- a/ltable.h
+++ b/ltable.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.h,v 1.36 2001/08/31 19:46:07 roberto Exp $ 2** $Id: ltable.h,v 1.37 2001/10/25 19:14:14 roberto Exp $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -10,9 +10,9 @@
10#include "lobject.h" 10#include "lobject.h"
11 11
12 12
13#define node(_t,_i) (&(_t)->node[_i]) 13#define node(t,i) (&(t)->node[i])
14#define key(_n) (&(_n)->key) 14#define key(n) (&(n)->_key)
15#define val(_n) (&(_n)->val) 15#define val(n) (&(n)->_val)
16 16
17#define settableval(p,v) setobj(cast(TObject *, p), v) 17#define settableval(p,v) setobj(cast(TObject *, p), v)
18 18
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) {
277 } 277 }
278 else 278 else
279 lua_pushstring(L, "<undef>"); 279 lua_pushstring(L, "<undef>");
280 luaA_pushobject(L, &t->node[i].val); 280 luaA_pushobject(L, val(&t->node[i]));
281 if (t->node[i].next) 281 if (t->node[i].next)
282 lua_pushnumber(L, t->node[i].next - t->node); 282 lua_pushnumber(L, t->node[i].next - t->node);
283 else 283 else