aboutsummaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'lobject.c')
-rw-r--r--lobject.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/lobject.c b/lobject.c
index f607aab2..5845e695 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 1.85 2002/07/17 16:25:13 roberto Exp roberto $ 2** $Id: lobject.c,v 1.86 2002/08/07 14:35:55 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*/
@@ -58,25 +58,17 @@ int luaO_log2 (unsigned int x) {
58int luaO_rawequalObj (const TObject *t1, const TObject *t2) { 58int luaO_rawequalObj (const TObject *t1, const TObject *t2) {
59 if (ttype(t1) != ttype(t2)) return 0; 59 if (ttype(t1) != ttype(t2)) return 0;
60 switch (ttype(t1)) { 60 switch (ttype(t1)) {
61 case LUA_TNUMBER:
62 return nvalue(t1) == nvalue(t2);
63 case LUA_TNIL: 61 case LUA_TNIL:
64 return 1; 62 return 1;
65 case LUA_TSTRING:
66 return tsvalue(t1) == tsvalue(t2);
67 case LUA_TBOOLEAN: 63 case LUA_TBOOLEAN:
68 return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ 64 return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */
69 case LUA_TLIGHTUSERDATA: 65 case LUA_TLIGHTUSERDATA:
70 return pvalue(t1) == pvalue(t2); 66 return pvalue(t1) == pvalue(t2);
71 case LUA_TUSERDATA: 67 case LUA_TNUMBER:
72 return uvalue(t1) == uvalue(t2); 68 return nvalue(t1) == nvalue(t2);
73 case LUA_TTABLE: 69 default:
74 return hvalue(t1) == hvalue(t2); 70 return gcvalue(t1) == gcvalue(t2);
75 case LUA_TFUNCTION:
76 return clvalue(t1) == clvalue(t2);
77 } 71 }
78 lua_assert(0);
79 return 0; /* to avoid warnings */
80} 72}
81 73
82 74