Clearer distinction between types and tags

LUA_T* represents only types; tags (types + Variants) are represented
by LUA_V* constants.
This commit is contained in:
Roberto Ierusalimschy
2020-01-31 11:09:53 -03:00
parent 69c7139ff8
commit 46c3587a6f
22 changed files with 231 additions and 213 deletions

6
ldo.c
View File

@@ -459,10 +459,10 @@ void luaD_call (lua_State *L, StkId func, int nresults) {
lua_CFunction f;
retry:
switch (ttypetag(s2v(func))) {
case LUA_TCCL: /* C closure */
case LUA_VCCL: /* C closure */
f = clCvalue(s2v(func))->f;
goto Cfunc;
case LUA_TLCF: /* light C function */
case LUA_VLCF: /* light C function */
f = fvalue(s2v(func));
Cfunc: {
int n; /* number of returns */
@@ -485,7 +485,7 @@ void luaD_call (lua_State *L, StkId func, int nresults) {
luaD_poscall(L, ci, n);
break;
}
case LUA_TLCL: { /* Lua function */
case LUA_VLCL: { /* Lua function */
CallInfo *ci;
Proto *p = clLvalue(s2v(func))->p;
int narg = cast_int(L->top - func) - 1; /* number of real arguments */