no need for two different implementations for equality (one raw and

one with metamethods)
This commit is contained in:
Roberto Ierusalimschy
2011-05-31 15:24:36 -03:00
parent 3f04a9f2c0
commit 9b7dddad7d
7 changed files with 27 additions and 36 deletions

6
lvm.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.h,v 2.14 2009/12/17 16:20:01 roberto Exp roberto $
** $Id: lvm.h,v 2.15 2011/04/05 18:32:06 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -19,10 +19,14 @@
#define equalobj(L,o1,o2) (ttisequal(o1, o2) && luaV_equalval_(L, o1, o2))
#define luaV_rawequalObj(t1,t2) \
(ttisequal(t1,t2) && luaV_equalval_(NULL,t1,t2))
/* not to called directly */
LUAI_FUNC int luaV_equalval_ (lua_State *L, const TValue *t1, const TValue *t2);
LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r);
LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);