aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-26 11:16:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-02-26 11:16:05 -0300
commitef8263f81fdde2310ebb15c9a3fe5e954d57cab5 (patch)
tree8532d24bcfc4c59212616bdae1b25f087f1eb179 /lvm.c
parent2952bc5fc9cdc05ed061539cb7be26899513f004 (diff)
downloadlua-ef8263f81fdde2310ebb15c9a3fe5e954d57cab5.tar.gz
lua-ef8263f81fdde2310ebb15c9a3fe5e954d57cab5.tar.bz2
lua-ef8263f81fdde2310ebb15c9a3fe5e954d57cab5.zip
better names for macros for tags and types.
rttype -> rawtt; ttyperaw -> withvariant; ttype -> ttypetag; tnov -> ttype
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lvm.c b/lvm.c
index 99e0d6b7..cd54369e 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.346 2018/02/21 19:43:44 roberto Exp roberto $ 2** $Id: lvm.c,v 2.347 2018/02/23 13:13:31 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -458,8 +458,8 @@ int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) {
458*/ 458*/
459int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { 459int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
460 const TValue *tm; 460 const TValue *tm;
461 if (ttype(t1) != ttype(t2)) { /* not the same variant? */ 461 if (ttypetag(t1) != ttypetag(t2)) { /* not the same variant? */
462 if (ttnov(t1) != ttnov(t2) || ttnov(t1) != LUA_TNUMBER) 462 if (ttype(t1) != ttype(t2) || ttype(t1) != LUA_TNUMBER)
463 return 0; /* only numbers can be equal with different variants */ 463 return 0; /* only numbers can be equal with different variants */
464 else { /* two numbers with different variants */ 464 else { /* two numbers with different variants */
465 lua_Integer i1, i2; /* compare them as integers */ 465 lua_Integer i1, i2; /* compare them as integers */
@@ -467,7 +467,7 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
467 } 467 }
468 } 468 }
469 /* values have same type and same variant */ 469 /* values have same type and same variant */
470 switch (ttype(t1)) { 470 switch (ttypetag(t1)) {
471 case LUA_TNIL: return 1; 471 case LUA_TNIL: return 1;
472 case LUA_TNUMINT: return (ivalue(t1) == ivalue(t2)); 472 case LUA_TNUMINT: return (ivalue(t1) == ivalue(t2));
473 case LUA_TNUMFLT: return luai_numeq(fltvalue(t1), fltvalue(t2)); 473 case LUA_TNUMFLT: return luai_numeq(fltvalue(t1), fltvalue(t2));
@@ -569,7 +569,7 @@ void luaV_concat (lua_State *L, int total) {
569*/ 569*/
570void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { 570void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) {
571 const TValue *tm; 571 const TValue *tm;
572 switch (ttype(rb)) { 572 switch (ttypetag(rb)) {
573 case LUA_TTABLE: { 573 case LUA_TTABLE: {
574 Table *h = hvalue(rb); 574 Table *h = hvalue(rb);
575 tm = fasttm(L, h->metatable, TM_LEN); 575 tm = fasttm(L, h->metatable, TM_LEN);