aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-01-04 11:37:07 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-01-04 11:37:07 -0200
commit63a752f961dc8b6ced4f398c7d4cafdfc2a6b9f0 (patch)
tree9f9a2b645c51a41a1cd8dc4f31d09e45bc8012fa
parent03d38b66fd60209f9e5219fac2429d762417723d (diff)
downloadlua-63a752f961dc8b6ced4f398c7d4cafdfc2a6b9f0.tar.gz
lua-63a752f961dc8b6ced4f398c7d4cafdfc2a6b9f0.tar.bz2
lua-63a752f961dc8b6ced4f398c7d4cafdfc2a6b9f0.zip
small improvements.
-rw-r--r--lobject.c6
-rw-r--r--lobject.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/lobject.c b/lobject.c
index 5c0e3dd8..0462fc8b 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 1.13 1998/06/19 16:14:09 roberto Exp $ 2** $Id: lobject.c,v 1.14 1998/12/27 20:25:20 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -40,9 +40,7 @@ int luaO_redimension (int oldsize)
40} 40}
41 41
42 42
43int luaO_equalObj (TObject *t1, TObject *t2) 43int luaO_equalval (TObject *t1, TObject *t2) {
44{
45 if (ttype(t1) != ttype(t2)) return 0;
46 switch (ttype(t1)) { 44 switch (ttype(t1)) {
47 case LUA_T_NIL: return 1; 45 case LUA_T_NIL: return 1;
48 case LUA_T_NUMBER: return nvalue(t1) == nvalue(t2); 46 case LUA_T_NUMBER: return nvalue(t1) == nvalue(t2);
diff --git a/lobject.h b/lobject.h
index 1266a825..09660474 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.23 1998/12/01 19:09:47 roberto Exp $ 2** $Id: lobject.h,v 1.24 1998/12/27 20:25:20 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -193,7 +193,9 @@ extern char *luaO_typenames[];
193 193
194extern TObject luaO_nilobject; 194extern TObject luaO_nilobject;
195 195
196int luaO_equalObj (TObject *t1, TObject *t2); 196#define luaO_equalObj(t1,t2) ((ttype(t1) != ttype(t2)) ? 0 \
197 : luaO_equalval(t1,t2))
198int luaO_equalval (TObject *t1, TObject *t2);
197int luaO_redimension (int oldsize); 199int luaO_redimension (int oldsize);
198void luaO_insertlist (GCnode *root, GCnode *node); 200void luaO_insertlist (GCnode *root, GCnode *node);
199double luaO_str2d (char *s); 201double luaO_str2d (char *s);