Fixed over 500 compile warnings. Mostly:

* Unused variables.
* Missing newlines at ends of #included files.
* signed int loop variables where the termination condition is an unsigned 'get number of' function.
* 'NULL' used inappropriately for an integer or character constant (NULL is a pointer)
* abstract base classes with no virtual destructor.
* Floating point constants used to initialise integer variables.
This commit is contained in:
sjbaker
2006-09-23 14:51:54 +00:00
parent ccced9fd82
commit f1627677df
78 changed files with 1629 additions and 1691 deletions

View File

@@ -77,4 +77,5 @@ class OverlappingPairCache : public BroadphaseInterface
};
#endif //OVERLAPPING_PAIR_CACHE_H
#endif //OVERLAPPING_PAIR_CACHE_H

View File

@@ -97,6 +97,7 @@ BroadphaseProxy* SimpleBroadphase::CreateProxy( const SimdVector3& min, const
class RemovingOverlapCallback : public OverlapCallback
{
protected:
virtual bool ProcessOverlap(BroadphasePair& pair)
{
assert(0);
@@ -107,7 +108,7 @@ class RemovePairContainingProxy
{
BroadphaseProxy* m_targetProxy;
protected:
virtual bool ProcessOverlap(BroadphasePair& pair)
{
SimpleBroadphaseProxy* proxy0 = static_cast<SimpleBroadphaseProxy*>(pair.m_pProxy0);

View File

@@ -39,4 +39,5 @@ struct CollisionAlgorithmCreateFunc
return 0;
}
};
#endif //COLLISION_CREATE_FUNC
#endif //COLLISION_CREATE_FUNC

View File

@@ -334,8 +334,6 @@ void CollisionDispatcher::DispatchAllCollisionPairs(OverlappingPairCache* pairCa
{
//m_blockedForChanges = true;
int i;
int dispatcherId = GetUniqueId();
CollisionPairCallback collisionCallback(dispatchInfo,this,dispatcherId);
@@ -344,4 +342,6 @@ void CollisionDispatcher::DispatchAllCollisionPairs(OverlappingPairCache* pairCa
//m_blockedForChanges = false;
}
}

View File

@@ -33,7 +33,6 @@ CollisionWorld::~CollisionWorld()
//clean up remaining objects
std::vector<CollisionObject*>::iterator i;
int index = 0;
for (i=m_collisionObjects.begin();
!(i==m_collisionObjects.end()); i++)

View File

@@ -141,4 +141,6 @@ float CompoundCollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* proxy0,
}
return hitFraction;
}
}

View File

@@ -30,12 +30,12 @@ class Dispatcher;
/// Place holder, not fully implemented yet
class CompoundCollisionAlgorithm : public CollisionAlgorithm
{
Dispatcher* m_dispatcher;
BroadphaseProxy m_compoundProxy;
BroadphaseProxy m_otherProxy;
std::vector<BroadphaseProxy> m_childProxies;
std::vector<CollisionAlgorithm*> m_childCollisionAlgorithms;
Dispatcher* m_dispatcher;
BroadphaseProxy m_compound;
BroadphaseProxy m_other;

View File

@@ -340,7 +340,6 @@ float ConvexConvexAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* proxy0,Broad
CollisionObject* col0 = static_cast<CollisionObject*>(m_box0.m_clientObject);
float squareMot0 = (col0->m_interpolationWorldTransform.getOrigin() - col0->m_worldTransform.getOrigin()).length2();
float squareMot1 = (col1->m_interpolationWorldTransform.getOrigin() - col1->m_worldTransform.getOrigin()).length2();
if (squareMot0 < col0->m_ccdSquareMotionTreshold &&
squareMot0 < col0->m_ccdSquareMotionTreshold)

View File

@@ -13,6 +13,11 @@ SimulationIslandManager::SimulationIslandManager()
{
}
SimulationIslandManager::~SimulationIslandManager()
{
}
void SimulationIslandManager::InitUnionFind(int n)
{
m_unionFind.reset(n);
@@ -131,17 +136,13 @@ bool PersistentManifoldSortPredicate(const PersistentManifold* lhs, const Persis
//
void SimulationIslandManager::BuildAndProcessIslands(Dispatcher* dispatcher,CollisionObjectArray& collisionObjects, IslandCallback* callback)
{
int numBodies = collisionObjects.size();
//we are going to sort the unionfind array, and store the element id in the size
//afterwards, we clean unionfind, to make sure no-one uses it anymore
GetUnionFind().sortIslands();
int numElem = GetUnionFind().getNumElements();
int startIslandIndex=0,endIslandIndex=1;
int endIslandIndex=1;
//update the sleeping state for bodies, if all are sleeping
for (int startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)

View File

@@ -29,6 +29,7 @@ class SimulationIslandManager
public:
SimulationIslandManager();
virtual ~SimulationIslandManager();
void InitUnionFind(int n);
@@ -56,3 +57,4 @@ public:
};
#endif //SIMULATION_ISLAND_MANAGER_H

View File

@@ -51,4 +51,5 @@ public:
};
#endif //SPHERE_SPHERE_COLLISION_ALGORITHM_H
#endif //SPHERE_SPHERE_COLLISION_ALGORITHM_H

View File

@@ -31,11 +31,6 @@ class BoxShape: public PolyhedralConvexShape
public:
virtual ~BoxShape()
{
}
SimdVector3 GetHalfExtents() const;
//{ return m_boxHalfExtents1 * m_localScaling;}
//const SimdVector3& GetHalfExtents() const{ return m_boxHalfExtents1;}
@@ -265,3 +260,4 @@ public:
};
#endif //OBB_BOX_MINKOWSKI_H

View File

@@ -25,11 +25,9 @@ subject to the following restrictions:
///CollisionShape provides generic interface for collidable objects
class CollisionShape
{
public:
CollisionShape()
:m_tempDebug(0)
CollisionShape() :m_tempDebug(0)
{
}
virtual ~CollisionShape()

View File

@@ -15,11 +15,6 @@ subject to the following restrictions:
#include "ConvexShape.h"
ConvexShape::~ConvexShape()
{
}
ConvexShape::ConvexShape()
:m_collisionMargin(CONVEX_DISTANCE_MARGIN),
m_localScaling(1.f,1.f,1.f)

View File

@@ -36,8 +36,6 @@ class ConvexShape : public CollisionShape
public:
ConvexShape();
virtual ~ConvexShape();
virtual SimdVector3 LocalGetSupportingVertex(const SimdVector3& vec)const;
virtual SimdVector3 LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec) const= 0;

View File

@@ -40,8 +40,8 @@ public:
LocalSupportVertexCallback(const SimdVector3& supportVecLocal)
: m_supportVertexLocal(0.f,0.f,0.f),
m_supportVecLocal(supportVecLocal),
m_maxDot(-1e30f)
m_maxDot(-1e30f),
m_supportVecLocal(supportVecLocal)
{
}
@@ -72,7 +72,6 @@ public:
SimdVector3 ConvexTriangleMeshShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec0)const
{
SimdVector3 supVec(0.f,0.f,0.f);
SimdScalar newDot,maxDot = -1e30f;
SimdVector3 vec = vec0;
SimdScalar lenSqr = vec.length2();
@@ -95,7 +94,6 @@ SimdVector3 ConvexTriangleMeshShape::LocalGetSupportingVertexWithoutMargin(const
void ConvexTriangleMeshShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
{
SimdScalar newDot;
//use 'w' component of supportVerticesOut?
{
for (int i=0;i<numVectors;i++)

View File

@@ -46,4 +46,6 @@ public:
#endif //CONVEX_TRIANGLEMESH_SHAPE_H
#endif //CONVEX_TRIANGLEMESH_SHAPE_H

View File

@@ -28,7 +28,7 @@ class PolyhedralConvexShape : public ConvexShape
public:
PolyhedralConvexShape();
//brute force implementations
virtual SimdVector3 LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
virtual void BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;

View File

@@ -28,8 +28,8 @@ protected:
SimdVector3 m_localAabbMax;
SimdVector3 m_planeNormal;
SimdScalar m_planeConstant;
SimdVector3 m_localScaling;
SimdScalar m_planeConstant;
public:
StaticPlaneShape(const SimdVector3& planeNormal,SimdScalar planeConstant);

View File

@@ -33,8 +33,6 @@ void StridingMeshInterface::InternalProcessAllTriangles(InternalTriangleIndexCal
int stride,numverts,numtriangles;
int gfxindex;
SimdVector3 triangle[3];
int tempIndices[3] = {0,0,0};
int graphicsindex=0;
float* graphicsbase;
SimdVector3 meshScaling = getScaling();