Skip to content

Commit

Permalink
glue: avoid some direct uses of "int"
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jul 13, 2024
1 parent f2ce84b commit 9d77eed
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/native/glue/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ inline static const RVec3 getPosition(jlong bodyVa) {
JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_Body_getObjectLayer
(JNIEnv *, jclass, jlong bodyVa) {
const Body * const pBody = reinterpret_cast<Body *> (bodyVa);
int result = pBody->GetObjectLayer();
ObjectLayer result = pBody->GetObjectLayer();
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/BodyCreationSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_BodyCreationSettings_
(JNIEnv *, jclass, jlong bodySettingsVa) {
const BodyCreationSettings * const pSettings
= reinterpret_cast<BodyCreationSettings *> (bodySettingsVa);
int result = pSettings->mObjectLayer;
ObjectLayer result = pSettings->mObjectLayer;
return (jint) result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/ConvexHullShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_ConvexHullShape_getNu
return result;
}

inline static const Vec3 getPoint(jlong shapeVa, int pointIndex) {
inline static const Vec3 getPoint(jlong shapeVa, jint pointIndex) {
const ConvexHullShape * const pShape
= reinterpret_cast<ConvexHullShape *> (shapeVa);
const Vec3 result = pShape->GetPoint(pointIndex);
Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/ConvexHullShapeSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_ConvexHullShapeSetti
const jfloat * const pFloats
= (jfloat *) pEnv->GetDirectBufferAddress(buffer);
Vec3 * const pPoints = new Vec3[numPoints];
for (int i = 0; i < numPoints; ++i) {
for (jint i = 0; i < numPoints; ++i) {
float x = pFloats[3 * i];
float y = pFloats[3 * i + 1];
float z = pFloats[3 * i + 2];
Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/IndexedTriangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_IndexedTriangle_getMa
(JNIEnv *, jclass, jlong triangleVa) {
const IndexedTriangle * const pTriangle
= reinterpret_cast<IndexedTriangle *> (triangleVa);
int result = pTriangle->mMaterialIndex;
uint32 result = pTriangle->mMaterialIndex;
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/IndexedTriangleNoMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_IndexedTriangleNoMate
(JNIEnv *, jclass, jlong triangleVa, jint cornerIndex) {
const IndexedTriangleNoMaterial * const pTriangle
= reinterpret_cast<IndexedTriangleNoMaterial *> (triangleVa);
int result = pTriangle->mIdx[cornerIndex];
uint32 result = pTriangle->mIdx[cornerIndex];
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/MeshShapeSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ JNIEXPORT jlong JNICALL Java_com_github_stephengold_joltjni_MeshShapeSettings_cr
const jfloat * const pFloats
= (jfloat *) pEnv->GetDirectBufferAddress(buffer);
VertexList vertices;
for (int i = 0; i < numVertices; ++i) {
for (jint i = 0; i < numVertices; ++i) {
const float x = pFloats[3 * i];
const float y = pFloats[3 * i + 1];
const float z = pFloats[3 * i + 2];
Expand Down
2 changes: 1 addition & 1 deletion src/main/native/glue/PhysicsSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,5 @@ JNIEXPORT jint JNICALL Java_com_github_stephengold_joltjni_PhysicsSystem_update
= reinterpret_cast<JobSystemThreadPool *> (jobSystemVa);
EPhysicsUpdateError result = pPhysicsSystem->Update(
deltaTime, collisionSteps, pAllocator, pJobSystem);
return (int) result;
return (jint) result;
}

0 comments on commit 9d77eed

Please sign in to comment.