diff options
Diffstat (limited to 'lobject.c')
-rw-r--r-- | lobject.c | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 2.23 2006/07/11 15:53:29 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.24 2006/11/22 11:02:03 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 | */ |
@@ -51,24 +51,6 @@ int luaO_fb2int (int x) { | |||
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
54 | int luaO_log2 (unsigned int x) { | ||
55 | static const lu_byte log_2[256] = { | ||
56 | 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, | ||
57 | 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, | ||
58 | 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, | ||
59 | 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, | ||
60 | 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, | ||
61 | 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, | ||
62 | 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, | ||
63 | 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 | ||
64 | }; | ||
65 | int l = -1; | ||
66 | while (x >= 256) { l += 8; x >>= 8; } | ||
67 | return l + log_2[x]; | ||
68 | |||
69 | } | ||
70 | |||
71 | |||
72 | int luaO_rawequalObj (const TValue *t1, const TValue *t2) { | 54 | int luaO_rawequalObj (const TValue *t1, const TValue *t2) { |
73 | if (ttype(t1) != ttype(t2)) return 0; | 55 | if (ttype(t1) != ttype(t2)) return 0; |
74 | else switch (ttype(t1)) { | 56 | else switch (ttype(t1)) { |