commit e812aa200234629d89351b6653d6ae737478ccd8
parent c31494df26db17fe65741cb2f994be1d43c4bfd3
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 17 Jun 2002 10:50:39 -0300
avoid assignments to TObject access macros
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lundump.c b/lundump.c
@@ -1,5 +1,5 @@
/*
-** $Id: lundump.c,v 1.40 2002/03/01 01:48:42 lhf Exp lhf $
+** $Id: lundump.c,v 1.41 2002/06/06 13:22:56 lhf Exp lhf $
** load pre-compiled Lua chunks
** See Copyright Notice in lua.h
*/
@@ -150,19 +150,20 @@ static void LoadConstants (lua_State* L, Proto* f, ZIO* Z, int swap)
for (i=0; i<n; i++)
{
TObject* o=&f->k[i];
- ttype(o)=LoadByte(L,Z);
- switch (ttype(o))
+ int t=LoadByte(L,Z);
+ switch (t)
{
case LUA_TNUMBER:
- nvalue(o)=LoadNumber(L,Z,swap);
+ setnvalue(o,LoadNumber(L,Z,swap));
break;
case LUA_TSTRING:
- tsvalue(o)=LoadString(L,Z,swap);
+ setsvalue(o,LoadString(L,Z,swap));
break;
case LUA_TNIL:
+ setnilvalue(o);
break;
default:
- luaG_runerror(L,"bad constant type (%d) in %s",ttype(o),ZNAME(Z));
+ luaG_runerror(L,"bad constant type (%d) in %s",t,ZNAME(Z));
break;
}
}