Bläddra i källkod

Suppressed 2 warnings that trigger when compiling with the -Wshadow flag with GCC (#1367)

Jorrit Rouwe 1 år sedan
förälder
incheckning
e3d3cdf644
2 ändrade filer med 10 tillägg och 0 borttagningar
  1. 5 0
      Jolt/Physics/Constraints/PathConstraint.h
  2. 5 0
      Jolt/Physics/StateRecorder.h

+ 5 - 0
Jolt/Physics/Constraints/PathConstraint.h

@@ -14,6 +14,9 @@
 
 JPH_NAMESPACE_BEGIN
 
+JPH_SUPPRESS_WARNING_PUSH
+JPH_GCC_SUPPRESS_WARNING("-Wshadow") // GCC complains about the 'Free' value conflicting with the 'Free' method
+
 /// How to constrain the rotation of the body to a PathConstraint
 enum class EPathRotationConstraintType
 {
@@ -25,6 +28,8 @@ enum class EPathRotationConstraintType
 	FullyConstrained,				///< Fully constrain the rotation of the body 2 to the rotation of body 1
 };
 
+JPH_SUPPRESS_WARNING_POP
+
 /// Path constraint settings, used to constrain the degrees of freedom between two bodies to a path
 ///
 /// The requirements of the path are that:

+ 5 - 0
Jolt/Physics/StateRecorder.h

@@ -13,6 +13,9 @@ class Body;
 class Constraint;
 class BodyID;
 
+JPH_SUPPRESS_WARNING_PUSH
+JPH_GCC_SUPPRESS_WARNING("-Wshadow") // GCC complains about the 'Constraints' value conflicting with the 'Constraints' typedef
+
 /// A bit field that determines which aspects of the simulation to save
 enum class EStateRecorderState : uint8
 {
@@ -24,6 +27,8 @@ enum class EStateRecorderState : uint8
 	All					= Global | Bodies | Contacts | Constraints					///< Save all state
 };
 
+JPH_SUPPRESS_WARNING_POP
+
 /// Bitwise OR operator for EStateRecorderState
 constexpr EStateRecorderState operator | (EStateRecorderState inLHS, EStateRecorderState inRHS)
 {