From d58e65547083db2592b8b375b454fa2e7a0209ac Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Fri, 12 Apr 2024 18:14:02 +0200 Subject: [PATCH] fix compilation for Release-builds by adding more [[maybe_unused]] statements (#1051) --- Jolt/Physics/Collision/Shape/ConvexShape.h | 2 +- Jolt/Physics/Collision/Shape/Shape.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jolt/Physics/Collision/Shape/ConvexShape.h b/Jolt/Physics/Collision/Shape/ConvexShape.h index 562403b52..00b7a5b60 100644 --- a/Jolt/Physics/Collision/Shape/ConvexShape.h +++ b/Jolt/Physics/Collision/Shape/ConvexShape.h @@ -46,7 +46,7 @@ class JPH_EXPORT ConvexShape : public Shape virtual uint GetSubShapeIDBitsRecursive() const override { return 0; } // Convex shapes don't have sub shapes // See Shape::GetMaterial - virtual const PhysicsMaterial * GetMaterial(const SubShapeID &inSubShapeID) const override { JPH_ASSERT(inSubShapeID.IsEmpty(), "Invalid subshape ID"); return GetMaterial(); } + virtual const PhysicsMaterial * GetMaterial([[maybe_unused]] const SubShapeID &inSubShapeID) const override { JPH_ASSERT(inSubShapeID.IsEmpty(), "Invalid subshape ID"); return GetMaterial(); } // See Shape::CastRay virtual bool CastRay(const RayCast &inRay, const SubShapeIDCreator &inSubShapeIDCreator, RayCastResult &ioHit) const override; diff --git a/Jolt/Physics/Collision/Shape/Shape.h b/Jolt/Physics/Collision/Shape/Shape.h index f7abc1e68..a2a2f2e8c 100644 --- a/Jolt/Physics/Collision/Shape/Shape.h +++ b/Jolt/Physics/Collision/Shape/Shape.h @@ -370,13 +370,13 @@ class JPH_EXPORT Shape : public RefTarget, public NonCopyable virtual void SaveMaterialState([[maybe_unused]] PhysicsMaterialList &outMaterials) const { /* By default do nothing */ } /// Restore the material references after calling sRestoreFromBinaryState. Note that the exact same materials need to be provided in the same order as returned by SaveMaterialState. - virtual void RestoreMaterialState([[maybe_unused]] const PhysicsMaterialRefC *inMaterials, uint inNumMaterials) { JPH_ASSERT(inNumMaterials == 0); } + virtual void RestoreMaterialState([[maybe_unused]] const PhysicsMaterialRefC *inMaterials, [[maybe_unused]] uint inNumMaterials) { JPH_ASSERT(inNumMaterials == 0); } /// Outputs the shape references that this shape has to outSubShapes. virtual void SaveSubShapeState([[maybe_unused]] ShapeList &outSubShapes) const { /* By default do nothing */ } /// Restore the shape references after calling sRestoreFromBinaryState. Note that the exact same shapes need to be provided in the same order as returned by SaveSubShapeState. - virtual void RestoreSubShapeState([[maybe_unused]] const ShapeRefC *inSubShapes, uint inNumShapes) { JPH_ASSERT(inNumShapes == 0); } + virtual void RestoreSubShapeState([[maybe_unused]] const ShapeRefC *inSubShapes, [[maybe_unused]] uint inNumShapes) { JPH_ASSERT(inNumShapes == 0); } using ShapeToIDMap = StreamUtils::ObjectToIDMap; using IDToShapeMap = StreamUtils::IDToObjectMap;