facebookarchive / RakNet

RakNet is a cross platform, open source, C++ networking engine for game programmers.
Other
3.3k stars 1.02k forks source link

Fixed an 'comparison between pointer and integer' error on clang std=c++... #56

Open tzaeru opened 9 years ago

tzaeru commented 9 years ago

Heya,

On Clang 3.4, with C++11 mode, there's a build error stemming from the comparison of integer and pointer. I don't think this should be an error according to the standard, but I figure that 'NULL' and 'false' are fully interchangeable in this context, so I changed the pointer comparison to be against 'NULL'.

Thanks, tz

ensiform commented 9 years ago

Since you're using C++11 mode, wouldn't nullptr be better?

tzaeru commented 9 years ago

Yeah, for me it would, but I suppose that using 'NULL' is more independent of compiler and C++ version while also being accepted by clang under C++11.

Luke1410 commented 7 years ago

Duplicates part of #29 which is integrated in https://github.com/SLikeSoft/SLikeNet (incorporated in SLikeNet 0.1.0).