Assortment of compiler warning cleanups#238
Merged
Causeless merged 2 commits intocortex-command-community:developmentfrom Nov 28, 2025
Merged
Assortment of compiler warning cleanups#238Causeless merged 2 commits intocortex-command-community:developmentfrom
Causeless merged 2 commits intocortex-command-community:developmentfrom
Conversation
Contributor
Author
|
oh what the heck |
Contributor
Author
|
ok now the CI passes don't ask me on ethics of serializing a |
Merged
via the queue into
cortex-command-community:development
with commit Nov 28, 2025
0160b86
4 checks passed
Contributor
Author
|
...I take it as that everything I listed and did here is just fine? lol |
Contributor
|
these are (almost) entirely semantic/style warnings, there's not much you can do wrong. (though technically the float divisions were actually better before since doing it the "correct" way causes subpixel misalignment, which will potentially cause issues at some point) |
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.
I built the project with
-Dwarning_level=2(-Wall -Wextra) with Clang and went over warnings in a few files.This doesn't comprehensively clean up all of them, only a few, but also a few tiny logic bugs I noticed. Kind of mostly looking for input on this, because I imagine there might be disagreements to some of those.
For instance:
if (var = MightReturnNull()) …because the intent might have been to use==instead, and advises to use double parentheses around the function as a way to explicitly denote the intent of assignment. I did that a bunch of times.Vector(which uses floats). I switched those around too.SceneMan.cppruns a function that returns astd::vectorand then doesstd::moveon that, which had Clang warnMoving a temporary object prevents copy elisionand suggest just removing it, so, yeah lolGetRoundNameusing a too smallnumStrbuffer, so I expanded it lolVector, so I gave it an explicit copy constructor. There was also a vice-versa of that warning forTimerso I gave it an explicit copy assignment operator lolWith this patch the game still compiles just fine. I played a few scenarios and a metagame and everything seems dandy.
But yeah, looking for input.