Skip to content

Commit 3cf7ad6

Browse files
committed
glue: reverse equality tests involving a constant
1 parent 109565c commit 3cf7ad6

25 files changed

+80
-80
lines changed

src/main/native/glue/co/ConvexHullBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_ConvexHullBuilder_ini
165165
const char *pMessage;
166166
const ConvexHullBuilder::EResult result
167167
= pBuilder->Initialize(maxVertices, tolerance, pMessage);
168-
if (result == ConvexHullBuilder::EResult::Success) {
168+
if (ConvexHullBuilder::EResult::Success == result) {
169169
pMessage = "";
170170
}
171171
jstring message = pEnv->NewStringUTF(pMessage);

src/main/native/glue/cu/CustomBodyActivationListener.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CustomBodyActivationListener : BodyActivationListener {
6363
void OnBodyActivated(const BodyID& inBodyID, uint64 inBodyUserData) override {
6464
JNIEnv *pAttachEnv;
6565
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
66-
JPH_ASSERT(retCode == JNI_OK);
66+
JPH_ASSERT(JNI_OK == retCode);
6767

6868
const jint id = inBodyID.GetIndexAndSequenceNumber();
6969
const jlong userData = inBodyUserData;
@@ -75,7 +75,7 @@ class CustomBodyActivationListener : BodyActivationListener {
7575
void OnBodyDeactivated(const BodyID& inBodyID, uint64 inBodyUserData) override {
7676
JNIEnv *pAttachEnv;
7777
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
78-
JPH_ASSERT(retCode == JNI_OK);
78+
JPH_ASSERT(JNI_OK == retCode);
7979

8080
const jint id = inBodyID.GetIndexAndSequenceNumber();
8181
const jlong userData = inBodyUserData;
@@ -87,7 +87,7 @@ class CustomBodyActivationListener : BodyActivationListener {
8787
~CustomBodyActivationListener() {
8888
JNIEnv *pAttachEnv;
8989
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
90-
JPH_ASSERT(retCode == JNI_OK);
90+
JPH_ASSERT(JNI_OK == retCode);
9191

9292
pAttachEnv->DeleteGlobalRef(mJavaObject);
9393
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCastRayCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CustomCastRayCollector : CastRayCollector {
5656
void AddHit(const RayCastResult& inResult) override {
5757
JNIEnv *pAttachEnv;
5858
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
59-
JPH_ASSERT(retCode == JNI_OK);
59+
JPH_ASSERT(JNI_OK == retCode);
6060

6161
const jlong resultVa = reinterpret_cast<jlong> (&inResult);
6262
pAttachEnv->CallVoidMethod(mJavaObject, mAddMethodId, resultVa);
@@ -67,7 +67,7 @@ class CustomCastRayCollector : CastRayCollector {
6767
~CustomCastRayCollector() {
6868
JNIEnv *pAttachEnv;
6969
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
70-
JPH_ASSERT(retCode == JNI_OK);
70+
JPH_ASSERT(JNI_OK == retCode);
7171

7272
pAttachEnv->DeleteGlobalRef(mJavaObject);
7373
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCastShapeBodyCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CustomCastShapeBodyCollector : CastShapeBodyCollector {
5656
void AddHit(const BroadPhaseCastResult &inResult) override {
5757
JNIEnv *pAttachEnv;
5858
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
59-
JPH_ASSERT(retCode == JNI_OK);
59+
JPH_ASSERT(JNI_OK == retCode);
6060

6161
const jlong resultVa = reinterpret_cast<jlong> (&inResult);
6262
pAttachEnv->CallVoidMethod(mJavaObject, mAddMethodId, resultVa);
@@ -67,7 +67,7 @@ class CustomCastShapeBodyCollector : CastShapeBodyCollector {
6767
~CustomCastShapeBodyCollector() {
6868
JNIEnv *pAttachEnv;
6969
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
70-
JPH_ASSERT(retCode == JNI_OK);
70+
JPH_ASSERT(JNI_OK == retCode);
7171

7272
pAttachEnv->DeleteGlobalRef(mJavaObject);
7373
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCastShapeCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CustomCastShapeCollector : CastShapeCollector {
5656
void AddHit(const ShapeCastResult& inResult) override {
5757
JNIEnv *pAttachEnv;
5858
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
59-
JPH_ASSERT(retCode == JNI_OK);
59+
JPH_ASSERT(JNI_OK == retCode);
6060

6161
const jlong resultVa = reinterpret_cast<jlong> (&inResult);
6262
pAttachEnv->CallVoidMethod(mJavaObject, mAddMethodId, resultVa);
@@ -67,7 +67,7 @@ class CustomCastShapeCollector : CastShapeCollector {
6767
~CustomCastShapeCollector() {
6868
JNIEnv *pAttachEnv;
6969
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
70-
JPH_ASSERT(retCode == JNI_OK);
70+
JPH_ASSERT(JNI_OK == retCode);
7171

7272
pAttachEnv->DeleteGlobalRef(mJavaObject);
7373
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCharacterContactListener.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class CustomCharacterContactListener : CharacterContactListener {
119119
Vec3& ioAngularVelocity) override {
120120
JNIEnv *pAttachEnv;
121121
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
122-
JPH_ASSERT(retCode == JNI_OK);
122+
JPH_ASSERT(JNI_OK == retCode);
123123

124124
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
125125
const jlong body2Va = reinterpret_cast<jlong> (&inBody2);
@@ -155,7 +155,7 @@ class CustomCharacterContactListener : CharacterContactListener {
155155
Vec3Arg inContactNormal, CharacterContactSettings& ioSettings) override {
156156
JNIEnv *pAttachEnv;
157157
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
158-
JPH_ASSERT(retCode == JNI_OK);
158+
JPH_ASSERT(JNI_OK == retCode);
159159

160160
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
161161
const jlong otherCharacterVa
@@ -184,7 +184,7 @@ class CustomCharacterContactListener : CharacterContactListener {
184184
Vec3Arg inContactNormal, CharacterContactSettings& ioSettings) override {
185185
JNIEnv *pAttachEnv;
186186
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
187-
JPH_ASSERT(retCode == JNI_OK);
187+
JPH_ASSERT(JNI_OK == retCode);
188188

189189
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
190190
const jlong otherCharacterVa
@@ -212,7 +212,7 @@ class CustomCharacterContactListener : CharacterContactListener {
212212
const SubShapeID& inSubShapeID2) override {
213213
JNIEnv *pAttachEnv;
214214
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
215-
JPH_ASSERT(retCode == JNI_OK);
215+
JPH_ASSERT(JNI_OK == retCode);
216216

217217
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
218218
const jint otherCharacterId = inOtherCharacterID.GetValue();
@@ -233,7 +233,7 @@ class CustomCharacterContactListener : CharacterContactListener {
233233
Vec3Arg inCharacterVelocity, Vec3& ioNewCharacterVelocity) override {
234234
JNIEnv *pAttachEnv;
235235
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
236-
JPH_ASSERT(retCode == JNI_OK);
236+
JPH_ASSERT(JNI_OK == retCode);
237237

238238
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
239239
const jlong otherCharacterVa
@@ -286,7 +286,7 @@ class CustomCharacterContactListener : CharacterContactListener {
286286
const SubShapeID& inSubShapeID2) override {
287287
JNIEnv *pAttachEnv;
288288
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
289-
JPH_ASSERT(retCode == JNI_OK);
289+
JPH_ASSERT(JNI_OK == retCode);
290290

291291
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
292292
const jlong otherCharacterVa
@@ -307,7 +307,7 @@ class CustomCharacterContactListener : CharacterContactListener {
307307
CharacterContactSettings& ioSettings) override {
308308
JNIEnv *pAttachEnv;
309309
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
310-
JPH_ASSERT(retCode == JNI_OK);
310+
JPH_ASSERT(JNI_OK == retCode);
311311

312312
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
313313
const jint bodyId2 = inBodyID2.GetIndexAndSequenceNumber();
@@ -335,7 +335,7 @@ class CustomCharacterContactListener : CharacterContactListener {
335335
CharacterContactSettings& ioSettings) override {
336336
JNIEnv *pAttachEnv;
337337
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
338-
JPH_ASSERT(retCode == JNI_OK);
338+
JPH_ASSERT(JNI_OK == retCode);
339339

340340
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
341341
const jint bodyId2 = inBodyID2.GetIndexAndSequenceNumber();
@@ -361,7 +361,7 @@ class CustomCharacterContactListener : CharacterContactListener {
361361
const BodyID& inBodyID2, const SubShapeID& inSubShapeID2) override {
362362
JNIEnv *pAttachEnv;
363363
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
364-
JPH_ASSERT(retCode == JNI_OK);
364+
JPH_ASSERT(JNI_OK == retCode);
365365

366366
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
367367
const jint bodyId2 = inBodyID2.GetIndexAndSequenceNumber();
@@ -381,7 +381,7 @@ class CustomCharacterContactListener : CharacterContactListener {
381381
Vec3Arg inCharacterVelocity, Vec3& ioNewCharacterVelocity) override {
382382
JNIEnv *pAttachEnv;
383383
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
384-
JPH_ASSERT(retCode == JNI_OK);
384+
JPH_ASSERT(JNI_OK == retCode);
385385

386386
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
387387
const jint bodyId2 = inBodyID2.GetIndexAndSequenceNumber();
@@ -431,7 +431,7 @@ class CustomCharacterContactListener : CharacterContactListener {
431431
const BodyID& inBodyID2, const SubShapeID& inSubShapeID2) override {
432432
JNIEnv *pAttachEnv;
433433
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
434-
JPH_ASSERT(retCode == JNI_OK);
434+
JPH_ASSERT(JNI_OK == retCode);
435435

436436
const jlong characterVa = reinterpret_cast<jlong> (inCharacter);
437437
const jint bodyId2 = inBodyID2.GetIndexAndSequenceNumber();
@@ -447,7 +447,7 @@ class CustomCharacterContactListener : CharacterContactListener {
447447
~CustomCharacterContactListener() {
448448
JNIEnv *pAttachEnv;
449449
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
450-
JPH_ASSERT(retCode == JNI_OK);
450+
JPH_ASSERT(JNI_OK == retCode);
451451

452452
pAttachEnv->DeleteGlobalRef(mJavaObject);
453453
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCollidePointCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CustomCollidePointCollector : CollidePointCollector {
5656
void AddHit(const CollidePointResult &inResult) override {
5757
JNIEnv *pAttachEnv;
5858
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
59-
JPH_ASSERT(retCode == JNI_OK);
59+
JPH_ASSERT(JNI_OK == retCode);
6060

6161
const jlong resultVa = reinterpret_cast<jlong> (&inResult);
6262
pAttachEnv->CallVoidMethod(mJavaObject, mAddMethodId, resultVa);
@@ -67,7 +67,7 @@ class CustomCollidePointCollector : CollidePointCollector {
6767
~CustomCollidePointCollector() {
6868
JNIEnv *pAttachEnv;
6969
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
70-
JPH_ASSERT(retCode == JNI_OK);
70+
JPH_ASSERT(JNI_OK == retCode);
7171

7272
pAttachEnv->DeleteGlobalRef(mJavaObject);
7373
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCollideShapeBodyCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CustomCollideShapeBodyCollector : CollideShapeBodyCollector {
5656
void AddHit(const BodyID &inResult) override {
5757
JNIEnv *pAttachEnv;
5858
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
59-
JPH_ASSERT(retCode == JNI_OK);
59+
JPH_ASSERT(JNI_OK == retCode);
6060

6161
const jint resultId = inResult.GetIndexAndSequenceNumber();
6262
pAttachEnv->CallVoidMethod(mJavaObject, mAddMethodId, resultId);
@@ -67,7 +67,7 @@ class CustomCollideShapeBodyCollector : CollideShapeBodyCollector {
6767
~CustomCollideShapeBodyCollector() {
6868
JNIEnv *pAttachEnv;
6969
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
70-
JPH_ASSERT(retCode == JNI_OK);
70+
JPH_ASSERT(JNI_OK == retCode);
7171

7272
pAttachEnv->DeleteGlobalRef(mJavaObject);
7373
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomCollideShapeCollector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class CustomCollideShapeCollector : CollideShapeCollector {
5656
void AddHit(const CollideShapeResult &inResult) override {
5757
JNIEnv *pAttachEnv;
5858
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
59-
JPH_ASSERT(retCode == JNI_OK);
59+
JPH_ASSERT(JNI_OK == retCode);
6060

6161
const jlong resultVa = reinterpret_cast<jlong> (&inResult);
6262
pAttachEnv->CallVoidMethod(mJavaObject, mAddMethodId, resultVa);
@@ -67,7 +67,7 @@ class CustomCollideShapeCollector : CollideShapeCollector {
6767
~CustomCollideShapeCollector() {
6868
JNIEnv *pAttachEnv;
6969
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
70-
JPH_ASSERT(retCode == JNI_OK);
70+
JPH_ASSERT(JNI_OK == retCode);
7171

7272
pAttachEnv->DeleteGlobalRef(mJavaObject);
7373
EXCEPTION_CHECK(pAttachEnv)

src/main/native/glue/cu/CustomContactListener.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class CustomContactListener : ContactListener {
7272
const ContactManifold& inManifold, ContactSettings& ioSettings) override {
7373
JNIEnv *pAttachEnv;
7474
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
75-
JPH_ASSERT(retCode == JNI_OK);
75+
JPH_ASSERT(JNI_OK == retCode);
7676

7777
const jlong body1Va = reinterpret_cast<jlong> (&inBody1);
7878
const jlong body2Va = reinterpret_cast<jlong> (&inBody2);
@@ -87,7 +87,7 @@ class CustomContactListener : ContactListener {
8787
const ContactManifold& inManifold, ContactSettings& ioSettings) override {
8888
JNIEnv *pAttachEnv;
8989
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
90-
JPH_ASSERT(retCode == JNI_OK);
90+
JPH_ASSERT(JNI_OK == retCode);
9191

9292
const jlong body1Va = reinterpret_cast<jlong> (&inBody1);
9393
const jlong body2Va = reinterpret_cast<jlong> (&inBody2);
@@ -102,7 +102,7 @@ class CustomContactListener : ContactListener {
102102
void OnContactRemoved(const SubShapeIDPair& pair) override {
103103
JNIEnv *pAttachEnv;
104104
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
105-
JPH_ASSERT(retCode == JNI_OK);
105+
JPH_ASSERT(JNI_OK == retCode);
106106

107107
const jlong pairVa = reinterpret_cast<jlong> (&pair);
108108
pAttachEnv->CallVoidMethod(mJavaObject, mRemovedMethodId, pairVa);
@@ -114,7 +114,7 @@ class CustomContactListener : ContactListener {
114114
RVec3Arg inBaseOffset, const CollideShapeResult& inCollisionResult) override {
115115
JNIEnv *pAttachEnv;
116116
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
117-
JPH_ASSERT(retCode == JNI_OK);
117+
JPH_ASSERT(JNI_OK == retCode);
118118

119119
const jlong body1Va = reinterpret_cast<jlong> (&inBody1);
120120
const jlong body2Va = reinterpret_cast<jlong> (&inBody2);
@@ -132,7 +132,7 @@ class CustomContactListener : ContactListener {
132132
~CustomContactListener() {
133133
JNIEnv *pAttachEnv;
134134
jint retCode = ATTACH_CURRENT_THREAD(mpVM, &pAttachEnv);
135-
JPH_ASSERT(retCode == JNI_OK);
135+
JPH_ASSERT(JNI_OK == retCode);
136136

137137
pAttachEnv->DeleteGlobalRef(mJavaObject);
138138
EXCEPTION_CHECK(pAttachEnv)

0 commit comments

Comments
 (0)