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

Replace NULL with nullptr #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Replace NULL with nullptr #134

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 19, 2018

Some zeros have also been replaced.

@pjasicek
Copy link
Owner

Thanks for the pull request but whole repository-wide search-and-replace of NULL with nullptr is not really the way to go nor do I see any reason to do this.

Most of the affected files would be libraries anyway - mainly Box2D but I also saw SDL headers getting NULL replaced with nullptr which is not good as SDL is pure C lib (even if it's just in the comments).

@ghost
Copy link
Author

ghost commented Nov 19, 2018

You're right, I'll rebase.
Edit:
Should be ok now.

@ghost
Copy link
Author

ghost commented Nov 22, 2018

"nor do I see any reason to do this."
Do you mean, you don't see advantage of using nullptr?

NULL is just zero, so it's able to implicit cast and call another (overloaded) function.
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nullptr

@@ -237,7 +237,7 @@ extern "C" {
typedef uLong uLongf;
typedef void *voidp;
typedef void *const voidpc;
#define Z_NULL 0
#define Z_nullptr 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the reasons I don't like system/project wide search-and-replace in already working (and not maintained) codebase :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for long response time, it should be fixed now.

@pjasicek
Copy link
Owner

Yes I know the difference between NULL and nullptr ;) Any new code based on C++11/14/17 standard should use nullptr instead of NULL.

Nonetheless, I really do not like the idea of even project-wide search-and-replace which in effect does not solve anything. Even more so when I do not work on this project anymore.

@jadsonosd
Copy link

Have to run in android too java runner.
I found a game for smartphone too :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants