| 72 | |
| 73 | |
| 74 | int luaO_rawequalObj (const TValue *t1, const TValue *t2) { |
| 75 | int ttype1 = ttype(t1); |
| 76 | int ttype2 = ttype(t2); |
| 77 | if (ttype1 == LUA_TUSERDATA || ttype2 == LUA_TUSERDATA) { |
| 78 | if (ttype1 == LUA_TNIL || ttype2 == LUA_TNIL) |
| 79 | return 0; |
| 80 | int eq; |
| 81 | if (luabb_eq(t1, t2, &eq) == 0) |
| 82 | return eq; |
| 83 | } |
| 84 | |
| 85 | if (ttype1 != ttype2) return 0; |
| 86 | switch (ttype1) { |
| 87 | case LUA_TNIL: |
| 88 | return 1; |
| 89 | case LUA_TNUMBER: |
| 90 | return luai_numeq(nvalue(t1), nvalue(t2)); |
| 91 | case LUA_TBOOLEAN: |
| 92 | return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ |
| 93 | case LUA_TLIGHTUSERDATA: |
| 94 | return pvalue(t1) == pvalue(t2); |
| 95 | default: |
| 96 | lua_assert(iscollectable(t1)); |
| 97 | return gcvalue(t1) == gcvalue(t2); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | |
| 102 | int luaO_str2d (const char *s, lua_Number *result) { |
no test coverage detected