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 /ltm.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 'ltm.c')
| -rw-r--r-- | ltm.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 2.63 2018/02/21 15:49:32 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 2.64 2018/02/23 13:13:31 roberto Exp roberto $ |
| 3 | ** Tag methods | 3 | ** Tag methods |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -70,7 +70,7 @@ const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { | |||
| 70 | 70 | ||
| 71 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { | 71 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
| 72 | Table *mt; | 72 | Table *mt; |
| 73 | switch (ttnov(o)) { | 73 | switch (ttype(o)) { |
| 74 | case LUA_TTABLE: | 74 | case LUA_TTABLE: |
| 75 | mt = hvalue(o)->metatable; | 75 | mt = hvalue(o)->metatable; |
| 76 | break; | 76 | break; |
| @@ -78,7 +78,7 @@ const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { | |||
| 78 | mt = uvalue(o)->metatable; | 78 | mt = uvalue(o)->metatable; |
| 79 | break; | 79 | break; |
| 80 | default: | 80 | default: |
| 81 | mt = G(L)->mt[ttnov(o)]; | 81 | mt = G(L)->mt[ttype(o)]; |
| 82 | } | 82 | } |
| 83 | return (mt ? luaH_getshortstr(mt, G(L)->tmname[event]) : luaO_nilobject); | 83 | return (mt ? luaH_getshortstr(mt, G(L)->tmname[event]) : luaO_nilobject); |
| 84 | } | 84 | } |
| @@ -96,7 +96,7 @@ const char *luaT_objtypename (lua_State *L, const TValue *o) { | |||
| 96 | if (ttisstring(name)) /* is '__name' a string? */ | 96 | if (ttisstring(name)) /* is '__name' a string? */ |
| 97 | return getstr(tsvalue(name)); /* use it as type name */ | 97 | return getstr(tsvalue(name)); /* use it as type name */ |
| 98 | } | 98 | } |
| 99 | return ttypename(ttnov(o)); /* else use standard type name */ | 99 | return ttypename(ttype(o)); /* else use standard type name */ |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | 102 | ||
