Skip to content

Fix 64-bit portability issues - #28

Closed
bobmoser76 wants to merge 6 commits into
themuffinator:mainfrom
bobmoser76:fix-64bit-portability
Closed

bobmoser76 wants to merge 6 commits into
themuffinator:mainfrom
bobmoser76:fix-64bit-portability

Conversation

@bobmoser76

Copy link
Copy Markdown
Contributor

Summary:

  • remove 32-bit assumptions from math bit operations and random seeds
  • make PVS word operations and script VM stack slots safe on 64-bit targets
  • index lexer punctuation tables with unsigned bytes

Validation:

  • fresh Meson debug build with the native Linux platform backend
  • client, dedicated server, and unified game module linked successfully
  • git diff --check

@themuffinator

Copy link
Copy Markdown
Owner

Thanks, this was a careful pass.

Since you opened it, main has been replaced by the new-prey rebase onto a much newer openQ4 engine, which already fixed most of these:

The Pvs.cpp change was still needed: on LP64 long is 8 bytes, so the visibility vectors lost their last word. I've ported it, credited to you, in #34.

Not taken:

  • The script VM slot change (intptr_t to int). main deliberately keeps the dhewm3-style pointer-sized slots, and the change would make existing x64 saves unloadable.
  • std::bit_cast, because the game's idlib builds as C++17 on main.
  • Sqrt to sqrtf. It changes Linux and macOS results, so it would need to be a change of its own.

Closing as superseded by #34. Thanks again.

themuffinator added a commit that referenced this pull request Nov 11, 2026
Port the fixes from #28, #29 and #32 that still apply after the rebase
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.

2 participants