@@ -383,10 +383,10 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) {
383383LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) {
384384 const TValue *o = L->getStackSubsystem ().indexToValue (L,idx);
385385 switch (ttypetag (o)) {
386- case LUA_VSHRSTR : return static_cast <lua_Unsigned>(tsvalue (o)->length ());
387- case LUA_VLNGSTR : return static_cast <lua_Unsigned>(tsvalue (o)->length ());
388- case LUA_VUSERDATA : return static_cast <lua_Unsigned>(uvalue (o)->getLen ());
389- case LUA_VTABLE : {
386+ case LuaT::SHRSTR : return static_cast <lua_Unsigned>(tsvalue (o)->length ());
387+ case LuaT::LNGSTR : return static_cast <lua_Unsigned>(tsvalue (o)->length ());
388+ case LuaT::USERDATA : return static_cast <lua_Unsigned>(uvalue (o)->getLen ());
389+ case LuaT::TABLE : {
390390 lua_Unsigned res;
391391 lua_lock (L);
392392 res = luaH_getn (L, hvalue (o));
@@ -438,8 +438,8 @@ LUA_API lua_State *lua_tothread (lua_State *L, int idx) {
438438LUA_API const void *lua_topointer (lua_State *L, int idx) {
439439 const TValue *o = L->getStackSubsystem ().indexToValue (L,idx);
440440 switch (ttypetag (o)) {
441- case LUA_VLCF : return cast_voidp (cast_sizet (fvalue (o)));
442- case LUA_VUSERDATA: case LUA_VLIGHTUSERDATA :
441+ case LuaT::LCF : return cast_voidp (cast_sizet (fvalue (o)));
442+ case LuaT::USERDATA: case LuaT::LIGHTUSERDATA :
443443 return touserdata (o);
444444 default : {
445445 if (iscollectable (o))
@@ -612,7 +612,7 @@ LUA_API int lua_pushthread (lua_State *L) {
612612
613613
614614static int auxgetstr (lua_State *L, const TValue *t, const char *k) {
615- lu_byte tag;
615+ LuaT tag;
616616 TString *str = TString::create (L, k);
617617 tag = luaV_fastget (t, str, s2v (L->getTop ().p ), luaH_getstr);
618618 if (!tagisempty (tag))
@@ -634,7 +634,7 @@ static int auxgetstr (lua_State *L, const TValue *t, const char *k) {
634634*/
635635static void getGlobalTable (lua_State *L, TValue *gt) {
636636 Table *registry = hvalue (G (L)->getRegistry ());
637- lu_byte tag = luaH_getint (registry, LUA_RIDX_GLOBALS, gt);
637+ LuaT tag = luaH_getint (registry, LUA_RIDX_GLOBALS, gt);
638638 (void )tag; /* avoid not-used warnings when checks are off */
639639 api_check (L, novariant (tag) == LUA_TTABLE, " global table must exist" );
640640}
@@ -652,7 +652,7 @@ LUA_API int lua_gettable (lua_State *L, int idx) {
652652 lua_lock (L);
653653 api_checkpop (L, 1 );
654654 TValue *t = L->getStackSubsystem ().indexToValue (L,idx);
655- lu_byte tag = luaV_fastget (t, s2v (L->getTop ().p - 1 ), s2v (L->getTop ().p - 1 ), luaH_get);
655+ LuaT tag = luaV_fastget (t, s2v (L->getTop ().p - 1 ), s2v (L->getTop ().p - 1 ), luaH_get);
656656 if (tagisempty (tag))
657657 tag = luaV_finishget (L, t, s2v (L->getTop ().p - 1 ), L->getTop ().p - 1 , tag);
658658 lua_unlock (L);
@@ -669,7 +669,7 @@ LUA_API int lua_getfield (lua_State *L, int idx, const char *k) {
669669LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) {
670670 lua_lock (L);
671671 TValue *t = L->getStackSubsystem ().indexToValue (L,idx);
672- lu_byte tag;
672+ LuaT tag;
673673 luaV_fastgeti (t, n, s2v (L->getTop ().p ), tag);
674674 if (tagisempty (tag)) {
675675 TValue key;
@@ -682,7 +682,7 @@ LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) {
682682}
683683
684684
685- static int finishrawget (lua_State *L, lu_byte tag) {
685+ static int finishrawget (lua_State *L, LuaT tag) {
686686 if (tagisempty (tag)) /* avoid copying empty items to the stack */
687687 setnilvalue (s2v (L->getTop ().p ));
688688 api_incr_top (L);
@@ -702,7 +702,7 @@ LUA_API int lua_rawget (lua_State *L, int idx) {
702702 lua_lock (L);
703703 api_checkpop (L, 1 );
704704 Table *t = gettable (L, idx);
705- lu_byte tag = luaH_get (t, s2v (L->getTop ().p - 1 ), s2v (L->getTop ().p - 1 ));
705+ LuaT tag = luaH_get (t, s2v (L->getTop ().p - 1 ), s2v (L->getTop ().p - 1 ));
706706 L->getStackSubsystem ().pop (); /* pop key */
707707 return finishrawget (L, tag);
708708}
@@ -711,7 +711,7 @@ LUA_API int lua_rawget (lua_State *L, int idx) {
711711LUA_API int lua_rawgeti (lua_State *L, int idx, lua_Integer n) {
712712 lua_lock (L);
713713 Table *t = gettable (L, idx);
714- lu_byte tag;
714+ LuaT tag;
715715 luaH_fastgeti (t, n, s2v (L->getTop ().p ), tag);
716716 return finishrawget (L, tag);
717717}
@@ -1290,15 +1290,15 @@ LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) {
12901290static const char *aux_upvalue (TValue *fi, int n, TValue **val,
12911291 GCObject **owner) {
12921292 switch (ttypetag (fi)) {
1293- case LUA_VCCL : { /* C closure */
1293+ case LuaT::CCL : { /* C closure */
12941294 CClosure *f = clCvalue (fi);
12951295 if (!(cast_uint (n) - 1u < cast_uint (f->getNumUpvalues ())))
12961296 return nullptr ; /* 'n' not in [1, f->getNumUpvalues()] */
12971297 *val = f->getUpvalue (n-1 );
12981298 if (owner) *owner = obj2gco (f);
12991299 return " " ;
13001300 }
1301- case LUA_VLCL : { /* Lua closure */
1301+ case LuaT::LCL : { /* Lua closure */
13021302 LClosure *f = clLvalue (fi);
13031303 TString *name;
13041304 Proto *p = f->getProto ();
@@ -1364,16 +1364,16 @@ static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) {
13641364LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
13651365 TValue *fi = L->getStackSubsystem ().indexToValue (L,fidx);
13661366 switch (ttypetag (fi)) {
1367- case LUA_VLCL : { /* lua closure */
1367+ case LuaT::LCL : { /* lua closure */
13681368 return *getupvalref (L, fidx, n, nullptr );
13691369 }
1370- case LUA_VCCL : { /* C closure */
1370+ case LuaT::CCL : { /* C closure */
13711371 CClosure *f = clCvalue (fi);
13721372 if (1 <= n && n <= f->getNumUpvalues ())
13731373 return f->getUpvalue (n - 1 );
13741374 /* else */
13751375 } /* FALLTHROUGH */
1376- case LUA_VLCF :
1376+ case LuaT::LCF :
13771377 return nullptr ; /* light C functions have no upvalues */
13781378 default : {
13791379 api_check (L, 0 , " function expected" );
0 commit comments