|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
-** $Id: lobject.c,v 2.23 2006/07/11 15:53:29 roberto Exp roberto $
|
|
|
+** $Id: lobject.c,v 2.24 2006/11/22 11:02:03 roberto Exp roberto $
|
|
|
** Some generic functions over Lua objects
|
|
|
** See Copyright Notice in lua.h
|
|
|
*/
|
|
@@ -51,24 +51,6 @@ int luaO_fb2int (int x) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-int luaO_log2 (unsigned int x) {
|
|
|
- static const lu_byte log_2[256] = {
|
|
|
- 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
|
|
|
- 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
|
|
|
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
|
|
|
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
|
|
|
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
|
|
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
|
|
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
|
|
|
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
|
|
|
- };
|
|
|
- int l = -1;
|
|
|
- while (x >= 256) { l += 8; x >>= 8; }
|
|
|
- return l + log_2[x];
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
int luaO_rawequalObj (const TValue *t1, const TValue *t2) {
|
|
|
if (ttype(t1) != ttype(t2)) return 0;
|
|
|
else switch (ttype(t1)) {
|