Skip to content

unify(common): Move Common system utilities to Core - #3203

Draft
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/common-system-utilities
Draft

unify(common): Move Common system utilities to Core#3203
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/common-system-utilities

Conversation

@Jaredl-Dev

Copy link
Copy Markdown

This moves 11 Common/System header/source pairs shared by Generals and Zero Hour into Core:

  • CriticalSection
  • DataChunk
  • Directory
  • DisabledTypes
  • encrypt
  • Geometry
  • KindOf
  • List
  • QuotedPrintable
  • StackDump
  • Upgrade

The files differ only in the product-name banner inside the opening license comment.

Verification

  • Win32 Release builds succeed for both Generals and Zero Hour.
  • VC6 Release builds succeed for both Generals and Zero Hour.
  • Verified all 22 Core files exactly match their original Zero Hour files.

@Jaredl-Dev
Jaredl-Dev force-pushed the unify/common-system-utilities branch from e514064 to ac5d1f6 Compare August 26, 2026 01:38
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Centralize shared Common system utilities in Core

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Centralizes eleven shared Common utility pairs in Core to eliminate product duplication.
• Rewires Generals and Zero Hour manifests to consume the Core implementations.
• Records completed migrations in the unification helper for future consolidation work.
Diagram

graph TD
  G["Generals Build"] --> C["Core Source List"] --> H["Shared Headers"]
  Z["Zero Hour Build"] --> C --> S["System Sources"]
  M["Unification Script"] --> C
Loading
High-Level Assessment

A single canonical Core copy is the appropriate approach because both products already share these implementations byte-for-byte. Keeping product-local copies or introducing link-based indirection would preserve duplication or complicate legacy build tooling without adding product-specific flexibility.

Files changed (26) +89 / -66

Refactor (22) +0 / -0
CriticalSection.hRelocate critical-section interfaces into Core +0/-0

Relocate critical-section interfaces into Core

• Moves the unchanged critical-section and scoped-lock declarations into Core for shared use by both products.

Core/GameEngine/Include/Common/CriticalSection.h

DataChunk.hRelocate data-chunk serialization interfaces into Core +0/-0

Relocate data-chunk serialization interfaces into Core

• Moves the unchanged chunk mapping, input, output, and parser declarations into the shared Core include tree.

Core/GameEngine/Include/Common/DataChunk.h

Directory.hRelocate directory utility interfaces into Core +0/-0

Relocate directory utility interfaces into Core

• Moves the unchanged directory and file-information declarations into Core as the common copy.

Core/GameEngine/Include/Common/Directory.h

DisabledTypes.hRelocate disabled-state masks into Core +0/-0

Relocate disabled-state masks into Core

• Moves the unchanged disabled-state enumeration, masks, and helpers into the shared Core include tree.

Core/GameEngine/Include/Common/DisabledTypes.h

Geometry.hRelocate geometry interfaces into Core +0/-0

Relocate geometry interfaces into Core

• Moves the unchanged geometry types and GeometryInfo declarations into Core for both game variants.

Core/GameEngine/Include/Common/Geometry.h

KindOf.hRelocate object-kind masks into Core +0/-0

Relocate object-kind masks into Core

• Moves the unchanged KindOf enumeration and bit-mask helpers into the shared Core include tree.

Core/GameEngine/Include/Common/KindOf.h

List.hRelocate linked-list interfaces into Core +0/-0

Relocate linked-list interfaces into Core

• Moves the unchanged LList and LListNode declarations into Core as the canonical implementation interface.

Core/GameEngine/Include/Common/List.h

QuotedPrintable.hRelocate quoted-printable interfaces into Core +0/-0

Relocate quoted-printable interfaces into Core

• Moves the unchanged ASCII and Unicode quoted-printable conversion declarations into Core.

Core/GameEngine/Include/Common/QuotedPrintable.h

StackDump.hRelocate stack-dump interfaces into Core +0/-0

Relocate stack-dump interfaces into Core

• Moves the unchanged stack tracing, symbol lookup, and exception-dump declarations into Core.

Core/GameEngine/Include/Common/StackDump.h

Upgrade.hRelocate upgrade-system interfaces into Core +0/-0

Relocate upgrade-system interfaces into Core

• Moves the unchanged upgrade masks, instances, templates, and UpgradeCenter declarations into Core.

Core/GameEngine/Include/Common/Upgrade.h

encrypt.hRelocate legacy encryption interface into Core +0/-0

Relocate legacy encryption interface into Core

• Moves the unchanged Westwood Online string-obfuscation declaration into the shared Core include tree.

Core/GameEngine/Include/Common/encrypt.h

CriticalSection.cppRelocate critical-section globals into Core +0/-0

Relocate critical-section globals into Core

• Moves the unchanged global critical-section definitions and optional performance gatherer into Core.

Core/GameEngine/Source/Common/System/CriticalSection.cpp

DataChunk.cppRelocate data-chunk serialization implementation into Core +0/-0

Relocate data-chunk serialization implementation into Core

• Moves the unchanged compressed stream handling and chunk serialization implementation into Core.

Core/GameEngine/Source/Common/System/DataChunk.cpp

Directory.cppRelocate directory utility implementation into Core +0/-0

Relocate directory utility implementation into Core

• Moves the unchanged, currently disabled Win32 directory enumeration implementation into Core.

Core/GameEngine/Source/Common/System/Directory.cpp

DisabledTypes.cppRelocate disabled-state definitions into Core +0/-0

Relocate disabled-state definitions into Core

• Moves the unchanged disabled-state names and global mask definitions into Core.

Core/GameEngine/Source/Common/System/DisabledTypes.cpp

Geometry.cppRelocate geometry calculations into Core +0/-0

Relocate geometry calculations into Core

• Moves the unchanged geometry parsing, bounds, intersection, and snapshot implementation into Core.

Core/GameEngine/Source/Common/System/Geometry.cpp

KindOf.cppRelocate object-kind definitions into Core +0/-0

Relocate object-kind definitions into Core

• Moves the unchanged KindOf name table and predefined masks into Core.

Core/GameEngine/Source/Common/System/KindOf.cpp

List.cppRelocate linked-list implementation into Core +0/-0

Relocate linked-list implementation into Core

• Moves the unchanged priority-sorted linked-list operations into the shared Core source tree.

Core/GameEngine/Source/Common/System/List.cpp

QuotedPrintable.cppRelocate quoted-printable conversions into Core +0/-0

Relocate quoted-printable conversions into Core

• Moves the unchanged ASCII and Unicode quoted-printable encoding and decoding implementation into Core.

Core/GameEngine/Source/Common/System/QuotedPrintable.cpp

StackDump.cppRelocate stack tracing implementation into Core +0/-0

Relocate stack tracing implementation into Core

• Moves the unchanged Windows stack walking, symbol resolution, and exception reporting implementation into Core.

Core/GameEngine/Source/Common/System/StackDump.cpp

Upgrade.cppRelocate upgrade-system implementation into Core +0/-0

Relocate upgrade-system implementation into Core

• Moves the unchanged upgrade lifecycle, template parsing, affordability, and serialization logic into Core.

Core/GameEngine/Source/Common/System/Upgrade.cpp

encrypt.cppRelocate legacy encryption implementation into Core +0/-0

Relocate legacy encryption implementation into Core

• Moves the unchanged fixed-length Westwood Online password obfuscation routine into Core.

Core/GameEngine/Source/Common/System/encrypt.cpp

Other (4) +89 / -66
CMakeLists.txtEnable shared system utilities in the Core source list +22/-22

Enable shared system utilities in the Core source list

• Activates the eleven relocated headers and eleven implementations in Core's GameEngine source manifest, making Core their canonical build owner.

Core/GameEngine/CMakeLists.txt

CMakeLists.txtDisable Generals-local copies of shared utilities +22/-22

Disable Generals-local copies of shared utilities

• Comments out the eleven headers and implementations now supplied by Core, preventing duplicate ownership in the Generals source list.

Generals/Code/GameEngine/CMakeLists.txt

CMakeLists.txtDisable Zero Hour-local copies of shared utilities +22/-22

Disable Zero Hour-local copies of shared utilities

• Comments out the eleven headers and implementations now supplied by Core, preventing duplicate ownership in the Zero Hour source list.

GeneralsMD/Code/GameEngine/CMakeLists.txt

unify_move_files.pyRecord completed Common utility migrations +23/-0

Record completed Common utility migrations

• Adds commented unify_file entries for the eleven completed header/source moves from Zero Hour into Core, preserving the migration recipe alongside prior unifications.

scripts/cpp/unify_move_files.py

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@Jaredl-Dev
Jaredl-Dev marked this pull request as draft August 26, 2026 07:01
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.

1 participant