Remove ctb(int) overload and update LuaT enums#71
Merged
NiceAndPeter merged 2 commits intomainfrom Nov 22, 2025
Merged
Conversation
Removed the `lu_byte ctb(int)` overload from ltvalue.h as it was unused.
All ctb() calls in the codebase use LuaT enum values, which call the
`LuaT ctb(LuaT)` overload. This simplifies the API and removes dead code.
Analysis:
- Searched codebase for all ctb() calls
- All calls use LuaT::* enum values (SHRSTR, LNGSTR, etc.)
- Calls like ctb(s->getType()) pass LuaT (from GCBase::getType())
- No integer literals or LUA_T* macros passed to ctb()
Changes:
- src/objects/ltvalue.h:318 - Removed ctb(int) overload
Testing:
- Build: ✅ Success (no compilation errors)
- Tests: ✅ All pass ("final OK !!!")
- Performance: ~4.46s avg (within normal variance)
Removed unused legacy helper functions and lu_byte overloads:
1. val_() - Old Value accessor (4 overloads) - 0 usages
2. valraw() - Old Value accessor wrapper (2 overloads) - 0 usages
3. rawtt_byte() - lu_byte version of rawtt - 0 usages
4. ttypetag_byte() - lu_byte version of ttypetag - 0 usages
5. checktag(const TValue* o, lu_byte t) - lu_byte overload - 0 usages
6. settt_(TValue* o, lu_byte t) - lu_byte overload - 0 usages
All current callers use LuaT enum types, making these legacy lu_byte
overloads and wrappers unnecessary. This continues the modernization
from Phase 122 Part 1 (removing ctb(int) overload).
Analysis:
- Searched codebase for usage of each function
- All are either completely unused or have LuaT-based alternatives
- All current checktag() calls use LuaT arguments
- All current settt_() calls use LuaT arguments
Changes:
- src/objects/ltvalue.h: Removed 6 legacy functions/overloads
- Total lines removed: 10
Testing:
- Build: ✅ Success (no compilation errors)
- Tests: ✅ All pass ("final OK !!!")
- Performance: ~4.52s avg (within normal variance)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.