Skip to content

Commit 7f20402

Browse files
author
Stewart Miles
authored
Merge pull request #79 from more-please/master
Fix C++11 warning - left shift of signed value is undefined
2 parents 17989af + 258dd34 commit 7f20402

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

liquidfun/Box2D/Box2D/Common/b2Settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typedef unsigned long long uint64;
7575
// We expand the API so that other languages (e.g. Java) can call into
7676
// our C++ more easily. Only set if when the flag is not externally defined.
7777
#if !defined(LIQUIDFUN_EXTERNAL_LANGUAGE_API)
78-
#if SWIG || LIQUIDFUN_UNIT_TESTS
78+
#if defined(SWIG) || defined(LIQUIDFUN_UNIT_TESTS)
7979
#define LIQUIDFUN_EXTERNAL_LANGUAGE_API 1
8080
#else
8181
#define LIQUIDFUN_EXTERNAL_LANGUAGE_API 0

liquidfun/Box2D/Box2D/Particle/b2ParticleSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static const uint32 yMask = ((1u << yTruncBits) - 1u) << yShift;
5252
static const uint32 xMask = ~yMask;
5353
static const uint32 relativeTagRight = 1u << xShift;
5454
static const uint32 relativeTagBottomLeft = (uint32)((1 << yShift) +
55-
(-1 << xShift));
55+
((~uint32(0)) << xShift));
5656

5757
static const uint32 relativeTagBottomRight = (1u << yShift) + (1u << xShift);
5858

liquidfun/Box2D/Box2D/Particle/b2ParticleSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <Box2D/Particle/b2Particle.h>
2424
#include <Box2D/Dynamics/b2TimeStep.h>
2525

26-
#if LIQUIDFUN_UNIT_TESTS
26+
#ifdef LIQUIDFUN_UNIT_TESTS
2727
#include <gtest/gtest.h>
2828
#endif // LIQUIDFUN_UNIT_TESTS
2929

0 commit comments

Comments
 (0)