-
Notifications
You must be signed in to change notification settings - Fork 644
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
Fix C++11 warning - left shift of signed value is undefined #79
Conversation
dbe2767
to
15f2219
Compare
@@ -52,7 +52,7 @@ static const uint32 yMask = ((1u << yTruncBits) - 1u) << yShift; | |||
static const uint32 xMask = ~yMask; | |||
static const uint32 relativeTagRight = 1u << xShift; | |||
static const uint32 relativeTagBottomLeft = (uint32)((1 << yShift) + | |||
(-1 << xShift)); | |||
(UINT32_MAX << xShift)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UINT32_MAX is a Windows specific constant. Instead you could do...
~((uint32)0) << xShift
which is pretty much the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UINT32_MAX isn't Windows, it's C99. But I've gone ahead and made that change.
@@ -75,7 +75,7 @@ typedef unsigned long long uint64; | |||
// We expand the API so that other languages (e.g. Java) can call into | |||
// our C++ more easily. Only set if when the flag is not externally defined. | |||
#if !defined(LIQUIDFUN_EXTERNAL_LANGUAGE_API) | |||
#if SWIG || LIQUIDFUN_UNIT_TESTS | |||
#if defined(SWIG) || defined(LIQUIDFUN_UNIT_TESTS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we have another instance of this in
#if LIQUIDFUN_UNIT_TESTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, done
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
CLAs look good, thanks! |
Thanks @iainmerrick |
A couple of small tweaks that I needed for a clean compile in Clang with pedantic warnings