aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-23 11:58:02 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-23 11:58:02 -0200
commite5743adb21c295e9903c394096c6f3737fb6dec4 (patch)
treee7eb7e12615bd9d4eba5c2b8956bc09f416cd361
parent514783de9d6cd538d1a51aa8979b7763132730ac (diff)
downloadlua-e5743adb21c295e9903c394096c6f3737fb6dec4.tar.gz
lua-e5743adb21c295e9903c394096c6f3737fb6dec4.tar.bz2
lua-e5743adb21c295e9903c394096c6f3737fb6dec4.zip
macros `key', `val', and `node' don't need the state
-rw-r--r--lapi.c10
-rw-r--r--lgc.c6
-rw-r--r--ltable.h8
3 files changed, 12 insertions, 12 deletions
diff --git a/lapi.c b/lapi.c
index 685f1ef7..371a2526 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.56 1999/11/11 17:02:40 roberto Exp roberto $ 2** $Id: lapi.c,v 1.57 1999/11/22 13:12:07 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -420,10 +420,10 @@ const char *lua_nextvar (lua_State *L, const char *varname) {
420int luaA_next (lua_State *L, const Hash *t, int i) { 420int luaA_next (lua_State *L, const Hash *t, int i) {
421 int tsize = t->size; 421 int tsize = t->size;
422 for (; i<tsize; i++) { 422 for (; i<tsize; i++) {
423 Node *n = node(L, t, i); 423 Node *n = node(t, i);
424 if (ttype(val(L, n)) != LUA_T_NIL) { 424 if (ttype(val(n)) != LUA_T_NIL) {
425 luaA_pushobject(L, key(L, n)); 425 luaA_pushobject(L, key(n));
426 luaA_pushobject(L, val(L, n)); 426 luaA_pushobject(L, val(n));
427 return i+1; /* index to be used next time */ 427 return i+1; /* index to be used next time */
428 } 428 }
429 } 429 }
diff --git a/lgc.c b/lgc.c
index ad82c411..fe55f3e7 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 1.31 1999/11/10 15:40:46 roberto Exp roberto $ 2** $Id: lgc.c,v 1.32 1999/11/22 13:12:07 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -54,8 +54,8 @@ static void hashmark (lua_State *L, Hash *h) {
54 int i; 54 int i;
55 h->marked = 1; 55 h->marked = 1;
56 for (i=h->size-1; i>=0; i--) { 56 for (i=h->size-1; i>=0; i--) {
57 Node *n = node(L, h,i); 57 Node *n = node(h,i);
58 if (ttype(key(L, n)) != LUA_T_NIL) { 58 if (ttype(key(n)) != LUA_T_NIL) {
59 markobject(L, &n->key); 59 markobject(L, &n->key);
60 markobject(L, &n->val); 60 markobject(L, &n->val);
61 } 61 }
diff --git a/ltable.h b/ltable.h
index 25a08d00..b9096627 100644
--- a/ltable.h
+++ b/ltable.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.h,v 1.15 1999/10/26 10:53:40 roberto Exp roberto $ 2** $Id: ltable.h,v 1.16 1999/11/22 13:12:07 roberto Exp roberto $
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(L, t,i) (&(t)->node[i]) 13#define node(t,i) (&(t)->node[i])
14#define key(L, n) (&(n)->key) 14#define key(n) (&(n)->key)
15#define val(L, n) (&(n)->val) 15#define val(n) (&(n)->val)
16 16
17#define luaH_move(L, t,from,to) (luaH_setint(L, t, to, luaH_getint(L, t, from))) 17#define luaH_move(L, t,from,to) (luaH_setint(L, t, to, luaH_getint(L, t, from)))
18 18