Skip to content

Commit

Permalink
Fixed -Wuninitialized warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jrouwe committed Dec 21, 2024
1 parent 58ba2cc commit 84d850c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/determinism_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,10 @@ jobs:
- name: Test Ragdoll
working-directory: ${{github.workspace}}/Build/Linux_Distribution
run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Ragdoll -validate_hash=${RAGDOLL_HASH}
- name: Test Pyramid
working-directory: ${{github.workspace}}/Build/Linux_Distribution
run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}
# This is slow so disabled for the moment
# - name: Test Pyramid
# working-directory: ${{github.workspace}}/Build/Linux_Distribution
# run: qemu-loongarch64 -L /usr/loongarch64-linux-gnu/ ./PerformanceTest -q=LinearCast -t=max -s=Pyramid -validate_hash=${PYRAMID_HASH}

emscripten:
runs-on: ubuntu-latest
Expand Down
20 changes: 0 additions & 20 deletions Jolt/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,6 @@
#error Unsupported CPU architecture
#endif

// CPU helper macros
#ifdef JPH_CPU_RISCV
#define JPH_IF_RISCV(x) x
#else
#define JPH_IF_RISCV(x)
#endif
#ifdef JPH_CPU_PPC
#define JPH_IF_PPC(x) x
#else
#define JPH_IF_PPC(x)
#endif
#ifdef JPH_CPU_LOONGARCH
#define JPH_IF_LOONGARCH(x) x
#else
#define JPH_IF_LOONGARCH(x)
#endif

// If this define is set, Jolt is compiled as a shared library
#ifdef JPH_SHARED_LIBRARY
#ifdef JPH_BUILD_SHARED_LIBRARY
Expand Down Expand Up @@ -372,9 +355,6 @@
JPH_GCC_SUPPRESS_WARNING("-Wpedantic") \
JPH_GCC_SUPPRESS_WARNING("-Wunused-parameter") \
JPH_GCC_SUPPRESS_WARNING("-Wmaybe-uninitialized") \
JPH_IF_RISCV(JPH_GCC_SUPPRESS_WARNING("-Wuninitialized")) \
JPH_IF_PPC(JPH_GCC_SUPPRESS_WARNING("-Wuninitialized")) \
JPH_IF_LOONGARCH(JPH_GCC_SUPPRESS_WARNING("-Wuninitialized")) \
\
JPH_MSVC_SUPPRESS_WARNING(4619) /* #pragma warning: there is no warning number 'XXXX' */ \
JPH_MSVC_SUPPRESS_WARNING(4514) /* 'X' : unreferenced inline function has been removed */ \
Expand Down
8 changes: 2 additions & 6 deletions Jolt/Math/Vec3.inl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ Vec3::Vec3(const Float3 &inV)
mF32[0] = inV[0];
mF32[1] = inV[1];
mF32[2] = inV[2];
#ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
mF32[3] = inV[2];
#endif
mF32[3] = inV[2]; // Not strictly needed when JPH_FLOATING_POINT_EXCEPTIONS_ENABLED is off but prevents warnings about uninitialized variables
#endif
}

Expand All @@ -82,9 +80,7 @@ Vec3::Vec3(float inX, float inY, float inZ)
mF32[0] = inX;
mF32[1] = inY;
mF32[2] = inZ;
#ifdef JPH_FLOATING_POINT_EXCEPTIONS_ENABLED
mF32[3] = inZ;
#endif
mF32[3] = inZ; // Not strictly needed when JPH_FLOATING_POINT_EXCEPTIONS_ENABLED is off but prevents warnings about uninitialized variables
#endif
}

Expand Down

0 comments on commit 84d850c

Please sign in to comment.