Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup some warnings from static analysis #16542

Merged
merged 6 commits into from
Dec 11, 2022

Conversation

unknownbrackets
Copy link
Collaborator

Given the recent texture issue causing some memory corruption, I thought I'd run a pass of MSVC's analyzer.

Some of this is just cleaned up override/const specifiers and some variable initialization, but there's a delete after free, and some range things that are probably for the better.

It's also a net negative on lines of code, which is nice.

-[Unknown]

Also missing virtual destructors, hidden non-overrides, etc.
We already have versions of these doing other conversions.
This makes what they do and which args to use clearer, if nothing else.
Cleaning up a lot of cases of uninitialized data, unchecked return values
for failures, and similar.
@unknownbrackets unknownbrackets added the Code Cleanup Cleanup to make future work easier. Needs to be done sometimes. label Dec 11, 2022
@unknownbrackets
Copy link
Collaborator Author

Potentially I could rebase out "Global: Cleanup initialization/pointer checks." (9cfcbc4) and make it a separate PR, because I think it's where any real risk is. That said, I tried to be pretty careful with the changes...

-[Unknown]

@hrydgard
Copy link
Owner

Skimmed through it, all of it looks safe enough. Let's get it in.

@hrydgard hrydgard merged commit 9317fbd into hrydgard:master Dec 11, 2022
@hrydgard hrydgard added this to the v1.14.0 milestone Dec 11, 2022
@unknownbrackets unknownbrackets deleted the warnings branch December 11, 2022 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Cleanup to make future work easier. Needs to be done sometimes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants