[WIP] Use nullptr in wincurse.cpp where appropriate #39033
Merged
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.
Still needs some more work to ensure that this update works across different platforms and compilers. Not ready for review. May need to split into another pull request for a separate fix that is currently included in this.
Summary
SUMMARY: None
Purpose of change
Compiling with GCC 9 through CMake with MSYS 2 on Windows 10 throws warnings which are treated as errors regarding zeros being used as null pointers. Important to note these warnings only seem to appear through CMake, not make.
Describe the solution
This change replaces zeros with
nullptr
where appropriate, removes the unused macro, and simplifies a couple of "if" statements. It also resolves an issue where an error is thrown only by CMake compiling for Windows regarding the _UNICODE define.Describe alternatives you've considered
I've tried compiling with Ubuntu 18.04 (using g++ 7 and then g++ 9 in separate tests) and it seems to be working as normal.
We could just not update those portions, but I believe it's not a bad idea to ensure these warnings get cleaned up.
Testing
Since this involves wincurse.cpp, build for curses and launch. Try using different features like options or load into the world. Close the game. There shouldn't be any errors in these displays.
Buildlog (ommitted user directories)