diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-11-29 18:21:46 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-11-29 18:21:46 -0200 |
commit | fca0a12e23f964006ce43d35ab86b27c6bbb0a48 (patch) | |
tree | 7c57492d6ae7d2b2178906e1968295b3ec83eb9f | |
parent | 72659a06050632da1a9b4c492302be46ac283f6b (diff) | |
download | lua-fca0a12e23f964006ce43d35ab86b27c6bbb0a48.tar.gz lua-fca0a12e23f964006ce43d35ab86b27c6bbb0a48.tar.bz2 lua-fca0a12e23f964006ce43d35ab86b27c6bbb0a48.zip |
avoid clashing names between macros and fields
-rw-r--r-- | ltable.c | 4 | ||||
-rw-r--r-- | ltable.h | 8 | ||||
-rw-r--r-- | ltests.c | 2 |
3 files changed, 7 insertions, 7 deletions
@@ -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++; |
@@ -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 | ||
@@ -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 |