Repository navigation
Fix 15 files that stopped compiling after the header syncs - #343
Merged
Merged
Conversation
The Ghidra header syncs a9401a7 and d972299 renamed or retyped fields, globals and parameters that 15 reimplemented files still use in their old form, so those files no longer compile once they are in the build list (main's committed list is empty, so CI does not see it). This follows a9401a7 (and d972299 for the last file): each old name becomes the name at the same address in the current header, an array that became a scalar loses its [0], and a parameter that became an enum gets the header's type or a cast. No header changes and no behaviour changes. With these, a full build of every reimplemented file compiles and links. PlayerData: counter -> availableCows (a9401a7) - AI/AICState/yieldCowThrow.cpp - Game/GameStateStructures/migrateGameStateForMapVersion.cpp - Map/Buildings/UpdateFireBallistaBuilding.cpp GameSynchronyState: someIndex -> selectedCommandsCount (a9401a7) - Synchrony/GameSynchronyState/processWaitingCommands.cpp Helpers::CheckGoldResource: int parameter -> UnitType, as the header now declares it (a9401a7) - UI/Helpers/CheckGoldResource.cpp: the definition takes UnitType - UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_TunnelerPortrait.cpp: the int button parameter is cast to Map::Units::UnitType at the call (plus the UnitType.hpp include) MenuTextInputState: DAT_ArrayOfMapU3EndInt2[501] -> int DAT_ArrayOfMapU3EndInt2, so [0] -> no index (a9401a7) - UI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cpp - UI/MenuTextInputState/loadOrSaveMap.cpp - UI/MenuTextInputState/activateLoadOrSaveMapUI.cpp, which also takes MenuModalType for its int parameter, as the header now declares activateLoadOrSaveMapUI Globals (a9401a7; include lines re-sorted by clang-format): - DAT_00b95b74 -> INT_00b95b74: UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cpp - DAT_00df3350 -> INT_00df3350: UI/MenuItems/BuildingAndStatusMenu/MenuItemActionHandler_BuildingAndStatusMenu_Unknown_Min1.cpp (which now stores -1 for 0xffffffff, since the global is an int), UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_BarracksWeaponAvailability.cpp - DAT_00df5554 -> INT_00df5554: UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp - INT_DisableTutorialRestrictions -> DAT_DisableTutorialRestrictions: UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cpp, UI/Helpers/UpdateTutorialStepAndProgress.cpp TribesState::spawnUnitsAroundLocation: undefined4 param_1 -> AITribeType tribeType (d972299) - Game/GameStateStructures/handleActivateTacticalPowers.cpp: the literal 1 is cast to AI::Tribes::AITribeType, which has no constant for 1 (plus the AITribeType.hpp include) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Style guide reading (advisory, posted once) 2 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 2 of the 15 reimplemented The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.
WhereRule 9 — Prefer
Rule 14 — The shape of a file
|
cpp-linter checks whole files; line 38 (unchanged by the renames) was indented one level too deep for clang-format. Whitespace only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
gynt
approved these changes
Nov 6, 2026
This was referenced Nov 6, 2026
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.
Main (57d3334) has 15
.cppfiles that no longer compile in a clean build, because the Ghidra syncs a9401a7 and d972299 renamed or retyped what they use in the headers. This PR moves them to main's names and types and changes nothing else: no header and no status line. All 15 functions stay at 100%, the same as their status lines.AI/AICState/yieldCowThrow.cppPlayerData.counteravailableCowsGame/GameStateStructures/migrateGameStateForMapVersion.cppPlayerData.counteravailableCowsMap/Buildings/UpdateFireBallistaBuilding.cppPlayerData.counteravailableCowsSynchrony/GameSynchronyState/processWaitingCommands.cppsomeIndexselectedCommandsCountUI/Helpers/CheckGoldResource.cppCheckGoldResource(int)CheckGoldResource(UnitType)UI/MenuItems/BuildingAndStatusMenu/..._TunnelerPortrait.cppinttoCheckGoldResourceUnitTypeUI/MenuItems/SaveLoadMap/MenuItemActionHandler_SaveLoadMap_Buttons.cppDAT_ArrayOfMapU3EndInt2[0](anint[501])DAT_ArrayOfMapU3EndInt2(anint)UI/MenuTextInputState/loadOrSaveMap.cppDAT_ArrayOfMapU3EndInt2[0]DAT_ArrayOfMapU3EndInt2UI/MenuTextInputState/activateLoadOrSaveMapUI.cppactivateLoadOrSaveMapUI(int),DAT_ArrayOfMapU3EndInt2[0]activateLoadOrSaveMapUI(MenuModalType),DAT_ArrayOfMapU3EndInt2UI/Rendering/DisplayMapDescriptionAndAllocatePlayersToSlots.cppDAT_00b95b74INT_00b95b74UI/MenuItems/BuildingAndStatusMenu/..._Unknown_Min1.cppDAT_00df3350 = 0xffffffffINT_00df3350 = -1(it is anintnow)UI/MenuItems/BuildingAndStatusMenu/..._BarracksWeaponAvailability.cppDAT_00df3350INT_00df3350UI/MenuItems/TutorialBox/MenuItemActionHandler_TutorialBox_Main.cppDAT_00df5554,INT_DisableTutorialRestrictionsINT_00df5554,DAT_DisableTutorialRestrictionsUI/Helpers/UpdateTutorialStepAndProgress.cppINT_DisableTutorialRestrictionsDAT_DisableTutorialRestrictionsGame/GameStateStructures/handleActivateTacticalPowers.cpp1tospawnUnitsAroundLocationAITribeType(d972299 retyped the parameter)The include lines follow the names, sorted by clang-format; the two casts bring their enum's include.
Built with the bundled MSVC1400-SP1, natively on Windows, against the Steam
Stronghold Crusader.exe(3bb0a8c1…5387ac5a): a clean full build compiles every reimplemented file and links (15 failures before), and each of the 15 functions measures 100.0% with sourcehold's reccmp (--resolve-wrapped-calls --ignore-security-cookie).status_regression.pyfinds nothing below a known score.Left as it is
AITribeTypehas no constant for 1, the type the tactical powers spawn, sohandleActivateTacticalPowerscasts it. A name for it would be a header change, which is yours to make in Ghidra.processWaitingCommands.cpp(line 38, whitespace only) that clang-format wanted one level shallower.openshc-pr-checkstill flags the first include ofUpdateFireBallistaBuilding.cpp,CheckGoldResource.cppand..._Unknown_Min1.cpp, which isn't their.func.hpp, and the style bot thewhileloop inprocessWaitingCommands.cpp. Both are main's own lines that this PR doesn't touch; we kept it to the renames, and are happy to tidy them here if you'd like.Other PRs: the ready #342, and the drafts #313, #318, #321, #327 and #328.
🤖 Generated with Claude Code