pjasicek / OpenClaw

Reimplementation of Captain Claw (1997) platformer
GNU General Public License v3.0
338 stars 39 forks source link

Replace NULL with nullptr #134

Open ghost opened 5 years ago

ghost commented 5 years ago

Some zeros have also been replaced.

pjasicek commented 5 years ago

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 commented 5 years ago

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

ghost commented 5 years ago

"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

pjasicek commented 5 years ago

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 commented 2 years ago

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