details
This commit is contained in:
18
lobject.c
18
lobject.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lobject.c,v 1.85 2002/07/17 16:25:13 roberto Exp roberto $
|
||||
** $Id: lobject.c,v 1.86 2002/08/07 14:35:55 roberto Exp roberto $
|
||||
** Some generic functions over Lua objects
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -58,25 +58,17 @@ int luaO_log2 (unsigned int x) {
|
||||
int luaO_rawequalObj (const TObject *t1, const TObject *t2) {
|
||||
if (ttype(t1) != ttype(t2)) return 0;
|
||||
switch (ttype(t1)) {
|
||||
case LUA_TNUMBER:
|
||||
return nvalue(t1) == nvalue(t2);
|
||||
case LUA_TNIL:
|
||||
return 1;
|
||||
case LUA_TSTRING:
|
||||
return tsvalue(t1) == tsvalue(t2);
|
||||
case LUA_TBOOLEAN:
|
||||
return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
return pvalue(t1) == pvalue(t2);
|
||||
case LUA_TUSERDATA:
|
||||
return uvalue(t1) == uvalue(t2);
|
||||
case LUA_TTABLE:
|
||||
return hvalue(t1) == hvalue(t2);
|
||||
case LUA_TFUNCTION:
|
||||
return clvalue(t1) == clvalue(t2);
|
||||
case LUA_TNUMBER:
|
||||
return nvalue(t1) == nvalue(t2);
|
||||
default:
|
||||
return gcvalue(t1) == gcvalue(t2);
|
||||
}
|
||||
lua_assert(0);
|
||||
return 0; /* to avoid warnings */
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user