diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-26 11:16:05 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-02-26 11:16:05 -0300 |
commit | ef8263f81fdde2310ebb15c9a3fe5e954d57cab5 (patch) | |
tree | 8532d24bcfc4c59212616bdae1b25f087f1eb179 /lvm.c | |
parent | 2952bc5fc9cdc05ed061539cb7be26899513f004 (diff) | |
download | lua-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 | */ |
459 | int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { | 459 | int 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 | */ |
570 | void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { | 570 | void 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); |