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

[WIP] Use nullptr in wincurse.cpp where appropriate #39033

Merged
merged 2 commits into from
Apr 2, 2020

Conversation

luluvia
Copy link
Contributor

@luluvia luluvia commented Mar 26, 2020

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)

@luluvia luluvia changed the title Use nullptr in wincurse.cpp where appropriate [WIP] Use nullptr in wincurse.cpp where appropriate Mar 26, 2020
@Qrox
Copy link
Contributor

Qrox commented Mar 26, 2020

I believe there was plan to obsolete the wincurse build? @ZhilkinSerg

@ZhilkinSerg
Copy link
Contributor

Yeah, but in the meantime small fixes are okay.

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system labels Mar 27, 2020
@ZhilkinSerg ZhilkinSerg merged commit 21307f9 into CleverRaven:master Apr 2, 2020
@luluvia luluvia deleted the wincurse-conventions branch April 28, 2020 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants