Browse Source

Fixed some sonar issues

Jorrit Rouwe 4 years ago
parent
commit
2d3127668e

+ 1 - 1
Jolt/Core/Factory.cpp

@@ -60,7 +60,7 @@ bool Factory::Register(const RTTI *inRTTI)
 	return true;
 }
 
-const vector<const RTTI *> Factory::GetAllClasses()
+vector<const RTTI *> Factory::GetAllClasses()
 {
 	vector<const RTTI *> all_classes;
 	all_classes.reserve(mClassNameMap.size());

+ 1 - 1
Jolt/Core/Factory.h

@@ -25,7 +25,7 @@ public:
 	bool						Register(const RTTI *inRTTI);
 
 	/// Get all registered classes
-	const vector<const RTTI *>	GetAllClasses();
+	vector<const RTTI *>		GetAllClasses();
 
 	/// Singleton factory instance
 	static Factory 				sInstance;

+ 1 - 1
Jolt/Geometry/EPAConvexHullBuilder.h

@@ -264,7 +264,7 @@ public:
 	/// Check if there's another triangle to process from the queue
 	bool				HasNextTriangle()
 	{
-		return mTriangleQueue.size() > 0;
+		return !mTriangleQueue.empty();
 	}
 
 	/// Access to the next closest triangle to the origin (won't remove it from the queue).

+ 0 - 1
Jolt/Physics/Collision/Shape/Shape.h

@@ -29,7 +29,6 @@ class PhysicsMaterial;
 class TransformedShape;
 class Plane;
 class Shape;
-class PhysicsMaterial;
 class StreamOut;
 class StreamIn;
 #ifdef JPH_DEBUG_RENDERER

+ 2 - 2
Jolt/Skeleton/SkeletalAnimation.cpp

@@ -86,12 +86,12 @@ void SkeletalAnimation::Sample(float inTime, SkeletonPose &ioPose) const
 		if (low == -1)
 		{
 			// Before first key, return first key
-			state = aj.mKeyframes.front();
+			state = static_cast<const JointState &>(aj.mKeyframes.front());
 		}
 		else if (high == (int)aj.mKeyframes.size())
 		{
 			// Beyond last key, return last key
-			state = aj.mKeyframes.back();
+			state = static_cast<const JointState &>(aj.mKeyframes.back());
 		}
 		else
 		{