refactor: Add override keyword to virtual function overrides in Libraries#2390
Conversation
|
| Filename | Overview |
|---|---|
| Core/Libraries/Source/WWVegas/WW3D2/collect.h | Adds override to all virtual overrides in CollectionClass; notably also adds virtual + override to Update_Sub_Object_Transforms() which was previously a non-virtual protected helper — valid because RenderObjClass declares it virtual in its public interface. |
| Core/Libraries/Source/WWVegas/WW3D2/rendobj.h | Adds override to Save/Load/Get_Factory and the virtual destructor; RenderObjClass inherits from RefCountClass and PersistClass (both with virtual destructors) so virtual ~RenderObjClass() override is valid. |
| Core/Libraries/Source/WWVegas/WWDebug/wwmemlog.cpp | Changes ~ActiveCategoryStackClass() to virtual ~ActiveCategoryStackClass() override — valid since it inherits from VectorClass which has a virtual destructor. |
| Core/Libraries/Source/WWVegas/WW3D2/dllist.h | Adds virtual + override to ~DLNodeClass(); inherits from W3DMPO which has a virtual destructor, so the change is valid. |
| Core/Libraries/Source/profile/internal_result.h | Adds override to WriteResults/Delete on ProfileResultFileCSV and ProfileResultFileDOT; GetName() is left without override but that is a pre-existing inconsistency outside this PR's scope. |
| Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.h | Adds override to all SimpleSceneClass virtual overrides; a handful of virtual methods like Get_Scene_ID() and Remove_All_Render_Objects() are left without override, which is a pre-existing pattern and not introduced by this PR. |
| Core/Libraries/Source/WWVegas/WWLib/Vector.h | Adds override to Resize/Clear/ID in DynamicVectorClass; straightforward and correct. |
| Core/Libraries/Source/WWVegas/WW3D2/composite.h | Mechanical addition of override to all virtual overrides in CompositeRenderObjClass; no functional changes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Base class declares\nvirtual function] --> B{Derived class\noverride?}
B -- Before PR\n'virtual' only --> C[Implicit override\nno compiler check]
B -- After PR\n'virtual ... override' --> D[Explicit override\ncompiler verifies signature match]
D --> E{Signature matches\nbase class?}
E -- Yes --> F[Compiles OK\nno behaviour change]
E -- No --> G[Compile error\nbug caught early]
C --> H[Silent mismatch possible\ne.g. typo in signature]
Reviews (5): Last reviewed commit: "fix: Add missing virtual keyword to dest..." | Re-trigger Greptile
|
This also needs rebase |
do you have the latest pulled locally? Github doesn't show a merge conflict for me |
|
But it still 4 commits present that are already in main branch. Something is not right. |
a0fc760 to
06c9db7
Compare
|
You're right - rebased, looks better now |
…methods in textureloader.h
xezon
left a comment
There was a problem hiding this comment.
I did not look at every line but hopefully this is alright.
Summary
overridekeyword to virtual function overrides in Libraries (WWVegas: WW3D2, WWAudio, WWLib, WWMath, WWSaveLoad, etc.)Context
Part 2/6 of splitting #2101. Depends on #2389 merging first.
Notes
overridekeyword additionsvirtualkeyword