Skip to content

Conversation

@NiceAndPeter
Copy link
Owner

Centralized all makevariant-based type variant constants in ltvalue.h for better organization and maintainability. This consolidation improves code organization by placing all type variant definitions in a single location immediately after the makevariant function definition.

Changes:

  • Moved LUA_TUPVAL and LUA_TPROTO type definitions to ltvalue.h
  • Moved all makevariant constants to ltvalue.h:
    • Nil variants: LUA_VNIL, LUA_VEMPTY, LUA_VABSTKEY, LUA_VNOTABLE
    • Boolean variants: LUA_VFALSE, LUA_VTRUE
    • Number variants: LUA_VNUMINT, LUA_VNUMFLT
    • String variants: LUA_VSHRSTR, LUA_VLNGSTR
    • Table variant: LUA_VTABLE
    • Function variants: LUA_VLCL, LUA_VLCF, LUA_VCCL
    • Userdata variants: LUA_VLIGHTUSERDATA, LUA_VUSERDATA
    • Thread variant: LUA_VTHREAD
    • Upvalue variant: LUA_VUPVAL
    • Proto variant: LUA_VPROTO
  • Removed duplicate definitions from:
    • lobject_core.h (11 constants)
    • lstring.h (2 constants)
    • lfunc.h (4 constants)
    • ltable.h (1 constant)
    • lproto.h (1 constant)
  • Added documentation comments to indicate new locations

All tests pass. Build time: ~3s, Test time: 4.62s

Centralized all makevariant-based type variant constants in ltvalue.h
for better organization and maintainability. This consolidation improves
code organization by placing all type variant definitions in a single
location immediately after the makevariant function definition.

Changes:
- Moved LUA_TUPVAL and LUA_TPROTO type definitions to ltvalue.h
- Moved all makevariant constants to ltvalue.h:
  * Nil variants: LUA_VNIL, LUA_VEMPTY, LUA_VABSTKEY, LUA_VNOTABLE
  * Boolean variants: LUA_VFALSE, LUA_VTRUE
  * Number variants: LUA_VNUMINT, LUA_VNUMFLT
  * String variants: LUA_VSHRSTR, LUA_VLNGSTR
  * Table variant: LUA_VTABLE
  * Function variants: LUA_VLCL, LUA_VLCF, LUA_VCCL
  * Userdata variants: LUA_VLIGHTUSERDATA, LUA_VUSERDATA
  * Thread variant: LUA_VTHREAD
  * Upvalue variant: LUA_VUPVAL
  * Proto variant: LUA_VPROTO
- Removed duplicate definitions from:
  * lobject_core.h (11 constants)
  * lstring.h (2 constants)
  * lfunc.h (4 constants)
  * ltable.h (1 constant)
  * lproto.h (1 constant)
- Added documentation comments to indicate new locations

All tests pass. Build time: ~3s, Test time: 4.62s
@NiceAndPeter NiceAndPeter merged commit eaceeaa into main Nov 22, 2025
11 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants