aboutsummaryrefslogtreecommitdiff
path: root/table.c
diff options
context:
space:
mode:
Diffstat (limited to 'table.c')
-rw-r--r--table.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/table.c b/table.c
index 5fc85f3d..a7b895d4 100644
--- a/table.c
+++ b/table.c
@@ -3,7 +3,7 @@
3** Module to control static tables 3** Module to control static tables
4*/ 4*/
5 5
6char *rcs_table="$Id: table.c,v 2.58 1996/11/01 12:47:45 roberto Exp roberto $"; 6char *rcs_table="$Id: table.c,v 2.59 1997/02/26 17:38:41 roberto Unstable roberto $";
7 7
8#include "mem.h" 8#include "mem.h"
9#include "opcode.h" 9#include "opcode.h"
@@ -64,7 +64,7 @@ Word luaI_findsymbol (TaggedString *t)
64 symbolEM, MAX_WORD); 64 symbolEM, MAX_WORD);
65 t->varindex = lua_ntable; 65 t->varindex = lua_ntable;
66 lua_table[lua_ntable].varname = t; 66 lua_table[lua_ntable].varname = t;
67 s_tag(lua_ntable) = LUA_T_NIL; 67 s_ttype(lua_ntable) = LUA_T_NIL;
68 lua_ntable++; 68 lua_ntable++;
69 } 69 }
70 return t->varindex; 70 return t->varindex;
@@ -128,11 +128,11 @@ static char *lua_travsymbol (int (*fn)(Object *))
128*/ 128*/
129int lua_markobject (Object *o) 129int lua_markobject (Object *o)
130{/* if already marked, does not change mark value */ 130{/* if already marked, does not change mark value */
131 if (tag(o) == LUA_T_STRING && !tsvalue(o)->marked) 131 if (ttype(o) == LUA_T_STRING && !tsvalue(o)->marked)
132 tsvalue(o)->marked = 1; 132 tsvalue(o)->marked = 1;
133 else if (tag(o) == LUA_T_ARRAY) 133 else if (ttype(o) == LUA_T_ARRAY)
134 lua_hashmark (avalue(o)); 134 lua_hashmark (avalue(o));
135 else if ((o->tag == LUA_T_FUNCTION || o->tag == LUA_T_MARK) 135 else if ((o->ttype == LUA_T_FUNCTION || o->ttype == LUA_T_MARK)
136 && !o->value.tf->marked) 136 && !o->value.tf->marked)
137 o->value.tf->marked = 1; 137 o->value.tf->marked = 1;
138 return 0; 138 return 0;
@@ -143,7 +143,7 @@ int lua_markobject (Object *o)
143*/ 143*/
144int luaI_ismarked (Object *o) 144int luaI_ismarked (Object *o)
145{ 145{
146 switch (o->tag) 146 switch (o->ttype)
147 { 147 {
148 case LUA_T_STRING: 148 case LUA_T_STRING:
149 return o->value.ts->marked; 149 return o->value.ts->marked;
@@ -207,7 +207,7 @@ void luaI_nextvar (void)
207 } 207 }
208 else 208 else
209 next = luaI_findsymbolbyname(lua_getstring(o)) + 1; 209 next = luaI_findsymbolbyname(lua_getstring(o)) + 1;
210 while (next < lua_ntable && s_tag(next) == LUA_T_NIL) next++; 210 while (next < lua_ntable && s_ttype(next) == LUA_T_NIL) next++;
211 if (next < lua_ntable) 211 if (next < lua_ntable)
212 { 212 {
213 lua_pushstring(lua_table[next].varname->str); 213 lua_pushstring(lua_table[next].varname->str);
@@ -219,14 +219,15 @@ void luaI_nextvar (void)
219static Object *functofind; 219static Object *functofind;
220static int checkfunc (Object *o) 220static int checkfunc (Object *o)
221{ 221{
222 if (o->tag == LUA_T_FUNCTION) 222 if (o->ttype == LUA_T_FUNCTION)
223 return 223 return
224 ((functofind->tag == LUA_T_FUNCTION || functofind->tag == LUA_T_MARK) 224 ((functofind->ttype == LUA_T_FUNCTION || functofind->ttype == LUA_T_MARK)
225 && (functofind->value.tf == o->value.tf)); 225 && (functofind->value.tf == o->value.tf));
226 if (o->tag == LUA_T_CFUNCTION) 226 if (o->ttype == LUA_T_CFUNCTION)
227 return 227 return
228 ((functofind->tag == LUA_T_CFUNCTION || functofind->tag == LUA_T_CMARK) 228 ((functofind->ttype == LUA_T_CFUNCTION ||
229 && (functofind->value.f == o->value.f)); 229 functofind->ttype == LUA_T_CMARK) &&
230 (functofind->value.f == o->value.f));
230 return 0; 231 return 0;
231} 232}
232 233