mirror of https://github.com/rusefi/lua.git
avoid clashing names between macros and fields
This commit is contained in:
parent
72659a0605
commit
fca0a12e23
4
ltable.c
4
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++;
|
||||
|
|
8
ltable.h
8
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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue