Skip to content

refactor: Apply the modernize-use-override check with clang-tidy - #3221

Open
CryoTheRenegade wants to merge 1 commit into
TheSuperHackers:mainfrom
CryoTheRenegade:refactor/modernize-use-override
Open

refactor: Apply the modernize-use-override check with clang-tidy#3221
CryoTheRenegade wants to merge 1 commit into
TheSuperHackers:mainfrom
CryoTheRenegade:refactor/modernize-use-override

Conversation

@CryoTheRenegade

@CryoTheRenegade CryoTheRenegade commented Aug 26, 2026

Copy link
Copy Markdown

Summary

Applies clang-tidy's modernize-use-override to the 846 hits from the modernize inventory. 80 .cpp files, Generals and Zero Hour kept in step.

Most of those hits were virtual on methods that already had override. The check drops the redundant virtual. The rest were local classes that were still missing override, mainly IMEManager, ViewerScene, and W3DView.

Clang-tidy produced the replacements. I filtered out compiler error-recovery edits, checked the diff, and built both games.

Headers are out of this PR. The inventory header filter does not match Windows paths, so the ~9k virtual ... override declarations in headers are a later pass if we want them.

VC6 is fine here. CppMacros.h turns override into nothing on that compiler.

Mark overriding methods with override and drop redundant virtual so MSVC can catch signature mismatches. VC6 still erases override through CppMacros.h.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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

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

Copy link
Copy Markdown

PR Summary by Qodo

Modernize C++ override declarations across source implementations

✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Marks previously implicit overrides so compilers can detect signature mismatches.
• Removes redundant virtual specifiers where override already expresses intent.
• Keeps shared Generals and Zero Hour implementation copies synchronized.
Diagram

graph TD
  Inventory["Modernize inventory"] --> Tidy["clang-tidy pass"] --> Core["Core sources"] --> Builds["Game builds"]
  Tidy --> Generals["Generals sources"] --> Builds
  Tidy --> ZeroHour["Zero Hour sources"] --> Builds
  Tidy --> Tools["Tool sources"] --> Builds
Loading
High-Level Assessment

The clang-tidy-driven implementation-only pass is appropriate: it minimizes manual error, preserves behavior, and keeps paired Generals and Zero Hour sources aligned. A single pass including headers was considered implicitly, but deferring headers is safer until the Windows-path header filter is corrected and the much larger declaration set can be reviewed separately.

Files changed (80) +848 / -848

Refactor (80) +848 / -848
FXList.cppSimplify FX override declarations +12/-12

Simplify FX override declarations

• Removes redundant 'virtual' specifiers from local FX implementation methods already marked 'override'.

Core/GameEngine/Source/GameClient/FXList.cpp

IMEManager.cppMake IMEManager overrides explicit +23/-23

Make IMEManager overrides explicit

• Replaces implicit virtual declarations with explicit 'override' annotations across the IME manager lifecycle, attachment, composition, candidate, and message APIs.

Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp

GameText.cppSimplify game text manager overrides +12/-12

Simplify game text manager overrides

• Drops redundant 'virtual' specifiers from GameTextManager methods and its overriding destructor.

Core/GameEngine/Source/GameClient/GameText.cpp

GSConfig.cppSimplify GameSpy configuration overrides +21/-21

Simplify GameSpy configuration overrides

• Removes redundant 'virtual' specifiers from GameSpy configuration accessors and lifecycle declarations.

Core/GameEngine/Source/GameNetwork/GameSpy/GSConfig.cpp

BuddyThread.cppSimplify buddy thread overrides +12/-12

Simplify buddy thread overrides

• Normalizes buddy queue and worker-thread declarations to use 'override' without redundant 'virtual'.

Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp

GameResultsThread.cppSimplify game-results thread overrides +13/-13

Simplify game-results thread overrides

• Normalizes game-results queue lifecycle, request/response, status, and worker declarations.

Core/GameEngine/Source/GameNetwork/GameSpy/Thread/GameResultsThread.cpp

PeerThread.cppSimplify peer thread overrides +12/-12

Simplify peer thread overrides

• Removes redundant 'virtual' from peer queue, connection, request/response, and worker overrides.

Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PeerThread.cpp

PersistentStorageThread.cppSimplify storage thread overrides +11/-11

Simplify storage thread overrides

• Normalizes persistent-storage queue, player-stat, and worker-thread override declarations.

Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PersistentStorageThread.cpp

PingThread.cppSimplify ping thread overrides +13/-13

Simplify ping thread overrides

• Removes redundant 'virtual' from ping queue lifecycle, status, lookup, and worker methods.

Core/GameEngine/Source/GameNetwork/GameSpy/Thread/PingThread.cpp

Network.cppSimplify network implementation overrides +48/-48

Simplify network implementation overrides

• Normalizes the local Network implementation's lifecycle, transport, gameplay, metrics, synchronization, and player API overrides.

Core/GameEngine/Source/GameNetwork/Network.cpp

W3DMouse.cppSimplify mouse worker override +1/-1

Simplify mouse worker override

• Drops the redundant 'virtual' specifier from the mouse thread entry point.

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DMouse.cpp

W3DShaderManager.cppSimplify shader strategy overrides +42/-42

Simplify shader strategy overrides

• Removes redundant 'virtual' specifiers from local shader initialization, setup, reset, and shutdown implementations.

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp

W3DTerrainVisual.cppSimplify terrain callback overrides +2/-2

Simplify terrain callback overrides

• Normalizes seismic filtering and gravity callback declarations already marked 'override'.

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTerrainVisual.cpp

W3DTreeBuffer.cppSimplify tree buffer reader override +1/-1

Simplify tree buffer reader override

• Removes redundant 'virtual' from the local buffer reader implementation.

Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp

WorldHeightMap.cppSimplify height-map reader override +1/-1

Simplify height-map reader override

• Removes redundant 'virtual' from the local height-map stream reader.

Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp

collect.cppSimplify collection prototype overrides +5/-5

Simplify collection prototype overrides

• Normalizes collection prototype factory, metadata, deletion, and destructor declarations.

Core/Libraries/Source/WWVegas/WW3D2/collect.cpp

proto.cppSimplify HModel prototype overrides +5/-5

Simplify HModel prototype overrides

• Normalizes HModel prototype factory, metadata, deletion, and destructor declarations.

Core/Libraries/Source/WWVegas/WW3D2/proto.cpp

rendobj.cppSimplify render persistence overrides +3/-3

Simplify render persistence overrides

• Removes redundant 'virtual' from render-object chunk persistence methods.

Core/Libraries/Source/WWVegas/WW3D2/rendobj.cpp

textureloader.cppSimplify texture worker override +1/-1

Simplify texture worker override

• Drops redundant 'virtual' from the texture loader thread entry point.

Core/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

wwmemlog.cppSimplify memory-log destructor override +1/-1

Simplify memory-log destructor override

• Removes redundant 'virtual' from the active category stack destructor.

Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp

ViewerScene.cppMark scene iterator overrides +4/-4

Mark scene iterator overrides

• Adds explicit 'override' annotations to ViewerSceneIterator traversal and item-access methods.

Core/Tools/W3DView/ViewerScene.cpp

W3DView.cppMark W3DView dialog overrides +2/-2

Mark W3DView dialog overrides

• Marks the about dialog's data-exchange and initialization methods as overrides.

Core/Tools/W3DView/W3DView.cpp

DownloadMenu.cppSimplify download callback overrides +5/-5

Simplify download callback overrides

• Removes redundant 'virtual' from download lifecycle, progress, status, and error callbacks.

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp

WOLLoginMenu.cppSimplify login preference overrides +3/-3

Simplify login preference overrides

• Normalizes the GameSpy login preferences destructor and persistence methods.

Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp

AI.cppSimplify AI filter overrides +2/-2

Simplify AI filter overrides

• Removes redundant 'virtual' from local AI object-filter predicates.

Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp

AIStates.cppSimplify AI state serialization overrides +6/-6

Simplify AI state serialization overrides

• Normalizes local AI state CRC, transfer, and post-load declarations.

Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp

ObjectCreationList.cppSimplify object factory overrides +8/-8

Simplify object factory overrides

• Removes redundant 'virtual' from local object-creation strategy methods.

Generals/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp

ChinookAIUpdate.cppSimplify Chinook state overrides +28/-28

Simplify Chinook state overrides

• Normalizes Chinook AI state lifecycle and serialization override declarations.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp

DozerAIUpdate.cppSimplify dozer state overrides +33/-33

Simplify dozer state overrides

• Normalizes dozer AI state lifecycle and serialization override declarations.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp

JetAIUpdate.cppSimplify jet state overrides +43/-43

Simplify jet state overrides

• Normalizes jet AI filters, state lifecycle, and serialization override declarations.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp

RailroadGuideAIUpdate.cppSimplify railroad filter override +1/-1

Simplify railroad filter override

• Removes redundant 'virtual' from the carriage-validation predicate.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp

SupplyTruckAIUpdate.cppSimplify supply-truck state overrides +12/-12

Simplify supply-truck state overrides

• Normalizes supply-truck AI state lifecycle and serialization declarations.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp

WorkerAIUpdate.cppSimplify worker state overrides +10/-10

Simplify worker state overrides

• Normalizes worker AI state lifecycle and serialization declarations.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp

FireSpreadUpdate.cppSimplify fire filter override +1/-1

Simplify fire filter override

• Removes redundant 'virtual' from the flammable-object predicate.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp

HordeUpdate.cppSimplify horde filter override +1/-1

Simplify horde filter override

• Removes redundant 'virtual' from the horde-member predicate.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp

StealthDetectorUpdate.cppSimplify stealth filter override +1/-1

Simplify stealth filter override

• Removes redundant 'virtual' from the stealth-detection predicate.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/StealthDetectorUpdate.cpp

TensileFormationUpdate.cppSimplify formation filter override +1/-1

Simplify formation filter override

• Removes redundant 'virtual' from the tensile-formation membership predicate.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp

VictoryConditions.cppSimplify victory condition overrides +12/-12

Simplify victory condition overrides

• Normalizes victory-condition lifecycle, result, observer, caching, and end-frame declarations.

Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp

W3DProjectedShadow.cppSimplify projected-shadow overrides +4/-4

Simplify projected-shadow overrides

• Removes redundant 'virtual' from shadow texture and missing-texture cache object declarations.

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp

W3DVolumetricShadow.cppSimplify volumetric-shadow overrides +4/-4

Simplify volumetric-shadow overrides

• Removes redundant 'virtual' from shadow geometry and missing-geometry cache object declarations.

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp

W3DAssetManager.cppSimplify asset prototype overrides +4/-4

Simplify asset prototype overrides

• Normalizes local asset prototype metadata, creation, and deletion declarations.

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp

W3DGhostObject.cppSimplify ghost serialization overrides +3/-3

Simplify ghost serialization overrides

• Removes redundant 'virtual' from ghost-object CRC, transfer, and post-load methods.

Generals/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp

assetmgr.cppSimplify asset iterator overrides +13/-13

Simplify asset iterator overrides

• Normalizes animation, font, and asset iterator traversal and metadata declarations.

Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp

dazzle.cppSimplify dazzle persistence overrides +3/-3

Simplify dazzle persistence overrides

• Removes redundant 'virtual' from dazzle chunk persistence methods.

Generals/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp

meshbuild.cppSimplify mesh hash overrides +5/-5

Simplify mesh hash overrides

• Normalizes mesh face matching, hashing, and hash metadata declarations.

Generals/Code/Libraries/Source/WWVegas/WW3D2/meshbuild.cpp

scene.cppSimplify scene iterator overrides +4/-4

Simplify scene iterator overrides

• Removes redundant 'virtual' from scene traversal and current-item methods.

Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp

ScriptDialog.cppSimplify script writer override +1/-1

Simplify script writer override

• Drops redundant 'virtual' from the local script output writer.

Generals/Code/Tools/WorldBuilder/src/ScriptDialog.cpp

WorldBuilder.cppSimplify WorldBuilder overrides +3/-3

Simplify WorldBuilder overrides

• Normalizes local file-factory declarations and the dialog data-exchange override.

Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp

WorldBuilderDoc.cppSimplify document writer overrides +3/-3

Simplify document writer overrides

• Removes redundant 'virtual' from local WorldBuilder document output writers.

Generals/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp

wbview3d.cppSimplify WorldBuilder view overrides +78/-78

Simplify WorldBuilder view overrides

• Removes redundant 'virtual' from PlaceholderView camera, viewport, filtering, locking, and rendering methods, plus SkeletonScene overrides.

Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp

DownloadMenu.cppMirror download callback cleanup +5/-5

Mirror download callback cleanup

• Applies the same download callback override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/DownloadMenu.cpp

WOLLoginMenu.cppMirror login preference cleanup +3/-3

Mirror login preference cleanup

• Applies the same GameSpy preference override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLoginMenu.cpp

AI.cppMirror AI filter cleanup +2/-2

Mirror AI filter cleanup

• Applies the same local AI filter override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp

AIStates.cppMirror AI state cleanup +6/-6

Mirror AI state cleanup

• Applies the same AI state serialization override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp

ObjectCreationList.cppMirror object factory cleanup +8/-8

Mirror object factory cleanup

• Applies the same object-creation strategy override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/ObjectCreationList.cpp

ChinookAIUpdate.cppSimplify Zero Hour Chinook overrides +33/-33

Simplify Zero Hour Chinook overrides

• Normalizes Zero Hour Chinook AI state lifecycle and serialization declarations.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp

DozerAIUpdate.cppMirror dozer state cleanup +33/-33

Mirror dozer state cleanup

• Applies the same dozer AI state override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DozerAIUpdate.cpp

JetAIUpdate.cppSimplify Zero Hour jet overrides +44/-44

Simplify Zero Hour jet overrides

• Normalizes Zero Hour jet AI filters, state lifecycle, and serialization declarations.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/JetAIUpdate.cpp

RailroadGuideAIUpdate.cppMirror railroad filter cleanup +1/-1

Mirror railroad filter cleanup

• Applies the carriage-validation predicate cleanup to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/RailroadGuideAIUpdate.cpp

SupplyTruckAIUpdate.cppMirror supply-truck state cleanup +12/-12

Mirror supply-truck state cleanup

• Applies the supply-truck AI override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/SupplyTruckAIUpdate.cpp

WorkerAIUpdate.cppMirror worker state cleanup +10/-10

Mirror worker state cleanup

• Applies the worker AI override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/WorkerAIUpdate.cpp

FireSpreadUpdate.cppMirror fire filter cleanup +1/-1

Mirror fire filter cleanup

• Applies the flammable-object predicate cleanup to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/FireSpreadUpdate.cpp

HordeUpdate.cppMirror horde filter cleanup +1/-1

Mirror horde filter cleanup

• Applies the horde-member predicate cleanup to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/HordeUpdate.cpp

SpectreGunshipUpdate.cppSimplify Spectre filter override +1/-1

Simplify Spectre filter override

• Removes redundant 'virtual' from the Zero Hour Spectre target predicate.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp

StealthDetectorUpdate.cppMirror stealth filter cleanup +1/-1

Mirror stealth filter cleanup

• Applies the stealth-detection predicate cleanup to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthDetectorUpdate.cpp

TensileFormationUpdate.cppMirror formation filter cleanup +1/-1

Mirror formation filter cleanup

• Applies the tensile-formation membership predicate cleanup to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/TensileFormationUpdate.cpp

VictoryConditions.cppMirror victory condition cleanup +12/-12

Mirror victory condition cleanup

• Applies the victory-condition override normalization to Zero Hour.

GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp

W3DProjectedShadow.cppMirror projected-shadow cleanup +4/-4

Mirror projected-shadow cleanup

• Applies projected-shadow cache object override normalization to Zero Hour.

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DProjectedShadow.cpp

W3DVolumetricShadow.cppMirror volumetric-shadow cleanup +4/-4

Mirror volumetric-shadow cleanup

• Applies volumetric-shadow cache object override normalization to Zero Hour.

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp

W3DAssetManager.cppMirror asset prototype cleanup +4/-4

Mirror asset prototype cleanup

• Applies local asset prototype override normalization to Zero Hour.

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp

W3DGhostObject.cppMirror ghost serialization cleanup +3/-3

Mirror ghost serialization cleanup

• Applies ghost-object serialization override normalization to Zero Hour.

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameLogic/W3DGhostObject.cpp

assetmgr.cppMirror asset iterator cleanup +13/-13

Mirror asset iterator cleanup

• Applies asset iterator traversal and metadata override normalization to Zero Hour.

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp

dazzle.cppMirror dazzle persistence cleanup +3/-3

Mirror dazzle persistence cleanup

• Applies dazzle persistence override normalization to Zero Hour.

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dazzle.cpp

meshbuild.cppMirror mesh hash cleanup +5/-5

Mirror mesh hash cleanup

• Applies mesh hash strategy override normalization to Zero Hour.

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/meshbuild.cpp

scene.cppMirror scene iterator cleanup +4/-4

Mirror scene iterator cleanup

• Applies scene iterator override normalization to Zero Hour.

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp

ScriptDialog.cppMirror script writer cleanup +1/-1

Mirror script writer cleanup

• Applies local script writer override normalization to Zero Hour WorldBuilder.

GeneralsMD/Code/Tools/WorldBuilder/src/ScriptDialog.cpp

WorldBuilder.cppMirror WorldBuilder override cleanup +3/-3

Mirror WorldBuilder override cleanup

• Normalizes Zero Hour file-factory and dialog data-exchange override declarations.

GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp

WorldBuilderDoc.cppMirror document writer cleanup +3/-3

Mirror document writer cleanup

• Applies document output writer override normalization to Zero Hour WorldBuilder.

GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilderDoc.cpp

wbview3d.cppSimplify Zero Hour view overrides +88/-88

Simplify Zero Hour view overrides

• Removes redundant 'virtual' from Zero Hour PlaceholderView camera and viewport APIs, including signatures unique to its expanded camera controls.

GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp

wdump.cppNormalize dump-tool overrides +2/-2

Normalize dump-tool overrides

• Modernizes local wdump class declarations to express overriding behavior with 'override' and without redundant 'virtual'.

GeneralsMD/Code/Tools/wdump/wdump.cpp

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Greptile Summary

This PR applies the modernize-use-override cleanup across shared, Generals, and Generals Zero Hour C++ sources.

  • Removes redundant virtual specifiers from methods already declared override.
  • Adds missing override specifiers to local implementations such as IMEManager, ViewerSceneIterator, and CAboutDlg.
  • Keeps corresponding Generals and GeneralsMD implementations synchronized.

Confidence Score: 5/5

The PR appears safe to merge because the changes preserve method signatures and virtual dispatch while tightening compile-time override checking.

The edited declarations either remove a redundant virtual while retaining override or add override to methods whose base signatures match; no behavioral, security, or build defect remains.

Important Files Changed

Filename Overview
Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp Adds override to the concrete IME manager methods; the signatures match the corresponding virtual interface declarations.
Core/Tools/W3DView/ViewerScene.cpp Marks all local scene-iterator implementations as overrides of matching SceneIterator methods.
Core/Tools/W3DView/W3DView.cpp Marks the standard MFC dialog hooks DoDataExchange and OnInitDialog as overrides.
Core/GameEngine/Source/GameNetwork/Network.cpp Removes redundant virtual specifiers while retaining override, preserving virtual dispatch and signatures.
Generals/Code/GameEngine/Source/GameLogic/AI/AI.cpp Performs the mechanical override-specifier cleanup for the Generals implementation.
GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AI.cpp Mirrors the mechanical override-specifier cleanup for the Zero Hour implementation.

Reviews (1): Last reviewed commit: "refactor: Apply the modernize-use-overri..." | Re-trigger Greptile

@Caball009

Copy link
Copy Markdown

The removals appear haphazard as it seems hard to imagine there are only ~850 virtual functions (marked with override).

In my opinion if a function is virtual it should start with the virtual keyword for clarity, so I'm not a fan of dropping virtual from virtual functions. In fact, I'd rather see the opposite: adding it if it's missing. If the declaration and definition are separate then it only needs to be applied to the declaration.

@CryoTheRenegade

Copy link
Copy Markdown
Author

The removals appear haphazard as it seems hard to imagine there are only ~850 virtual functions (marked with override).

yea but this is only in cpp source files, if we wanted to do headers. the functions would incerease to 1100+ header files and 9600+ function definitions. No functions were touched that introduce the virtual to a vtable. So that whittled down the number a bit.

In my opinion if a function is virtual it should start with the virtual keyword for clarity, so I'm not a fan of dropping virtual from virtual functions. In fact, I'd rather see the opposite: adding it if it's missing. If the declaration and definition are separate then it only needs to be applied to the declaration.

IMO its just redundant as override implies a virtual function and is in line with C++ spec https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#rh-override

@Caball009

Caball009 commented Aug 27, 2026

Copy link
Copy Markdown

Almost all virtual functions are currently marked with virtual. I think it's easier to just stick with that.

IMO its just redundant as override implies a virtual function and is in line with C++ spec https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#rh-override

It's a reasonable guideline, but the readability argument is subjective imo. I'd argue the following change makes it harder to see that this function is virtual, not easier:

void doFXPos(const Coord3D *primary, const Matrix3D* /*primaryMtx*/, const Real /*primarySpeed*/, const Coord3D * /*secondary*/, const Real /*overrideRadius*/ ) const override

@CryoTheRenegade

Copy link
Copy Markdown
Author

I can see that, i would like to get a second opinion from @xezon or @bobtista to see how the repo should handle this

@Mauller

Mauller commented Aug 27, 2026

Copy link
Copy Markdown

I am also of the mindset of using

virtual type funcName() const override

instead of

type funcName() const override

since the former at a glance gives a good idea that a function is virtual and likely inheriting from a sub class.
the C++ committee should have had override replace virtual directly on child classes instead of append it to the function.

It's much nicer to tell at a glance that a function is virtual.

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