removed some warnings

This commit is contained in:
erwin.coumans
2008-05-21 23:29:35 +00:00
parent 09fbd19279
commit ea86559480
11 changed files with 139 additions and 131 deletions

View File

@@ -68,11 +68,13 @@ static void clearHash (SpuSolverHash* hash)
hash->m_currentMask[0][SPU_HASH_NUMCELLDWORDS-1] |= (1 << i); hash->m_currentMask[0][SPU_HASH_NUMCELLDWORDS-1] |= (1 << i);
} }
} }
/*
static bool getDependency(SpuSolverHash* hash, unsigned int i, unsigned int j) static bool getDependency(SpuSolverHash* hash, unsigned int i, unsigned int j)
{ {
return (hash->m_dependencyMatrix[i][j >> 5] & (1 << (j & 31))) != 0; return (hash->m_dependencyMatrix[i][j >> 5] & (1 << (j & 31))) != 0;
} }
*/
static unsigned int getObjectIndex (btCollisionObject* object) static unsigned int getObjectIndex (btCollisionObject* object)
{ {
@@ -231,7 +233,7 @@ public:
}; };
static void printDependencyMatrix(SpuSolverHash* hash) /*static void printDependencyMatrix(SpuSolverHash* hash)
{ {
for (int r = 0; r < SPU_HASH_NUMCELLS; ++r) for (int r = 0; r < SPU_HASH_NUMCELLS; ++r)
{ {
@@ -252,6 +254,7 @@ static void printDependencyMatrix(SpuSolverHash* hash)
printf("\n"); printf("\n");
fflush(stdout); fflush(stdout);
} }
*/
// Solver caches // Solver caches
btAlignedObjectArray<SpuSolverBody> solverBodyPool_persist; btAlignedObjectArray<SpuSolverBody> solverBodyPool_persist;
@@ -525,7 +528,7 @@ SpuSolverTaskDesc* SolverTaskScheduler::getTask()
if (m_taskBusy[m_currentTask]) if (m_taskBusy[m_currentTask])
{ {
//try to find a new one //try to find a new one
for (unsigned int i = 0; i < m_maxNumOutstandingTasks; ++i) for (int i = 0; i < m_maxNumOutstandingTasks; ++i)
{ {
if (!m_taskBusy[i]) if (!m_taskBusy[i])
{ {

View File

@@ -26,7 +26,7 @@ class SolverTaskScheduler
{ {
protected: protected:
class btThreadSupportInterface* m_threadInterface; class btThreadSupportInterface* m_threadInterface;
unsigned int m_maxNumOutstandingTasks; int m_maxNumOutstandingTasks;
unsigned int m_currentTask; unsigned int m_currentTask;
unsigned int m_numBusyTasks; unsigned int m_numBusyTasks;
@@ -43,7 +43,7 @@ public:
void issueTask(); void issueTask();
void flushTasks(); void flushTasks();
unsigned int getMaxOutstandingTasks() int getMaxOutstandingTasks()
{ {
return m_maxNumOutstandingTasks; return m_maxNumOutstandingTasks;
} }

View File

@@ -273,7 +273,7 @@ if(leafs.size()>1)
tNodeArray sets[2]; tNodeArray sets[2];
int bestaxis=-1; int bestaxis=-1;
int bestmidp=leafs.size(); int bestmidp=leafs.size();
int splitcount[3][2]={0,0,0,0,0,0}; int splitcount[3][2]={{0,0},{0,0},{0,0}};
for(int i=0;i<leafs.size();++i) for(int i=0;i<leafs.size();++i)
{ {
const btVector3 x=leafs[i]->volume.Center()-org; const btVector3 x=leafs[i]->volume.Center()-org;
@@ -286,7 +286,7 @@ if(leafs.size()>1)
{ {
if((splitcount[i][0]>0)&&(splitcount[i][1]>0)) if((splitcount[i][0]>0)&&(splitcount[i][1]>0))
{ {
const int midp=abs(splitcount[i][0]-splitcount[i][1]); const int midp=(int)btFabs(btScalar(splitcount[i][0]-splitcount[i][1]));
if(midp<bestmidp) if(midp<bestmidp)
{ {
bestaxis=i; bestaxis=i;

View File

@@ -30,11 +30,13 @@ subject to the following restrictions:
#ifdef DBVT_USE_TEMPLATE #ifdef DBVT_USE_TEMPLATE
#define DBVT_VIRTUAL #define DBVT_VIRTUAL
#define DBVT_VIRTUAL_DESTRUCTOR(a)
#define DBVT_PREFIX template <typename T> #define DBVT_PREFIX template <typename T>
#define DBVT_IPOLICY T& policy #define DBVT_IPOLICY T& policy
#define DBVT_CHECKTYPE static const ICollide& typechecker=*(T*)0; #define DBVT_CHECKTYPE static const ICollide& typechecker=*(T*)0;
#else #else
#define DBVT_VIRTUAL virtual #define DBVT_VIRTUAL_DESTRUCTOR(a) virtual ~a() {}
#define DBVT_VIRTUAL virtual
#define DBVT_PREFIX #define DBVT_PREFIX
#define DBVT_IPOLICY ICollide& policy #define DBVT_IPOLICY ICollide& policy
#define DBVT_CHECKTYPE #define DBVT_CHECKTYPE
@@ -110,13 +112,13 @@ struct btDbvt
struct sStkNP struct sStkNP
{ {
const Node* node; const Node* node;
unsigned mask; int mask;
sStkNP(const Node* n,unsigned m) : node(n),mask(m) {} sStkNP(const Node* n,unsigned m) : node(n),mask(m) {}
}; };
struct sStkNPS struct sStkNPS
{ {
const Node* node; const Node* node;
unsigned mask; int mask;
btScalar value; btScalar value;
sStkNPS(const Node* n,unsigned m,btScalar v) : node(n),mask(m),value(v) {} sStkNPS(const Node* n,unsigned m,btScalar v) : node(n),mask(m),value(v) {}
}; };
@@ -125,6 +127,7 @@ struct btDbvt
/* ICollide */ /* ICollide */
struct ICollide struct ICollide
{ {
DBVT_VIRTUAL_DESTRUCTOR(ICollide)
DBVT_VIRTUAL void Process(const Node*,const Node*) {} DBVT_VIRTUAL void Process(const Node*,const Node*) {}
DBVT_VIRTUAL void Process(const Node*) {} DBVT_VIRTUAL void Process(const Node*) {}
DBVT_VIRTUAL bool Descent(const Node*) { return(true); } DBVT_VIRTUAL bool Descent(const Node*) { return(true); }
@@ -133,6 +136,7 @@ struct btDbvt
/* IWriter */ /* IWriter */
struct IWriter struct IWriter
{ {
virtual ~IWriter() {}
virtual void Prepare(const Node* root,int numnodes)=0; virtual void Prepare(const Node* root,int numnodes)=0;
virtual void WriteNode(const Node*,int index,int parent,int child0,int child1)=0; virtual void WriteNode(const Node*,int index,int parent,int child0,int child1)=0;
virtual void WriteLeaf(const Node*,int index,int parent)=0; virtual void WriteLeaf(const Node*,int index,int parent)=0;
@@ -178,27 +182,27 @@ struct btDbvt
const Node* root1, const Node* root1,
DBVT_IPOLICY); DBVT_IPOLICY);
DBVT_PREFIX DBVT_PREFIX
static void collideTV( const Node* root, static void collideTV( const Node* root,
const Volume& volume, const Volume& volume,
DBVT_IPOLICY); DBVT_IPOLICY);
DBVT_PREFIX DBVT_PREFIX
static void collideRAY( const Node* root, static void collideRAY( const Node* root,
const btVector3& origin, const btVector3& origin,
const btVector3& direction, const btVector3& direction,
DBVT_IPOLICY); DBVT_IPOLICY);
DBVT_PREFIX DBVT_PREFIX
static void collideKDOP(const Node* root, static void collideKDOP(const Node* root,
const btVector3* normals, const btVector3* normals,
const btScalar* offsets, const btScalar* offsets,
int count, int count,
DBVT_IPOLICY); DBVT_IPOLICY);
DBVT_PREFIX DBVT_PREFIX
static void collideOCL( const Node* root, static void collideOCL( const Node* root,
const btVector3* normals, const btVector3* normals,
const btScalar* offsets, const btScalar* offsets,
const btVector3& sortaxis, const btVector3& sortaxis,
int count, int count,
DBVT_IPOLICY); DBVT_IPOLICY);
DBVT_PREFIX DBVT_PREFIX
static void collideTU( const Node* root, static void collideTU( const Node* root,
DBVT_IPOLICY); DBVT_IPOLICY);
@@ -454,93 +458,93 @@ inline void btDbvt::collideTT( const Node* root0,
DBVT_IPOLICY) DBVT_IPOLICY)
{ {
DBVT_CHECKTYPE DBVT_CHECKTYPE
if(root0&&root1) if(root0&&root1)
{ {
btAlignedObjectArray<sStkNN> stack; btAlignedObjectArray<sStkNN> stack;
stack.reserve(DOUBLE_STACKSIZE); stack.reserve(DOUBLE_STACKSIZE);
stack.push_back(sStkNN(root0,root1)); stack.push_back(sStkNN(root0,root1));
do { do {
sStkNN p=stack[stack.size()-1]; sStkNN p=stack[stack.size()-1];
stack.pop_back(); stack.pop_back();
if(p.a==p.b) if(p.a==p.b)
{ {
if(p.a->isinternal()) if(p.a->isinternal())
{ {
stack.push_back(sStkNN(p.a->childs[0],p.a->childs[0])); stack.push_back(sStkNN(p.a->childs[0],p.a->childs[0]));
stack.push_back(sStkNN(p.a->childs[1],p.a->childs[1])); stack.push_back(sStkNN(p.a->childs[1],p.a->childs[1]));
stack.push_back(sStkNN(p.a->childs[0],p.a->childs[1])); stack.push_back(sStkNN(p.a->childs[0],p.a->childs[1]));
} }
} }
else if(Intersect(p.a->volume,p.b->volume)) else if(Intersect(p.a->volume,p.b->volume))
{ {
if(p.a->isinternal()) if(p.a->isinternal())
{ {
if(p.b->isinternal()) if(p.b->isinternal())
{ {
stack.push_back(sStkNN(p.a->childs[0],p.b->childs[0])); stack.push_back(sStkNN(p.a->childs[0],p.b->childs[0]));
stack.push_back(sStkNN(p.a->childs[1],p.b->childs[0])); stack.push_back(sStkNN(p.a->childs[1],p.b->childs[0]));
stack.push_back(sStkNN(p.a->childs[0],p.b->childs[1])); stack.push_back(sStkNN(p.a->childs[0],p.b->childs[1]));
stack.push_back(sStkNN(p.a->childs[1],p.b->childs[1])); stack.push_back(sStkNN(p.a->childs[1],p.b->childs[1]));
} }
else else
{ {
stack.push_back(sStkNN(p.a->childs[0],p.b)); stack.push_back(sStkNN(p.a->childs[0],p.b));
stack.push_back(sStkNN(p.a->childs[1],p.b)); stack.push_back(sStkNN(p.a->childs[1],p.b));
} }
} }
else else
{ {
if(p.b->isinternal()) if(p.b->isinternal())
{ {
stack.push_back(sStkNN(p.a,p.b->childs[0])); stack.push_back(sStkNN(p.a,p.b->childs[0]));
stack.push_back(sStkNN(p.a,p.b->childs[1])); stack.push_back(sStkNN(p.a,p.b->childs[1]));
} }
else else
{ {
policy.Process(p.a,p.b); policy.Process(p.a,p.b);
} }
} }
} }
} while(stack.size()>0); } while(stack.size()>0);
} }
} }
// //
DBVT_PREFIX DBVT_PREFIX
inline void btDbvt::collideTV( const Node* root, inline void btDbvt::collideTV( const Node* root,
const Volume& volume, const Volume& volume,
DBVT_IPOLICY) DBVT_IPOLICY)
{ {
DBVT_CHECKTYPE DBVT_CHECKTYPE
if(root) if(root)
{ {
btAlignedObjectArray<const Node*> stack; btAlignedObjectArray<const Node*> stack;
stack.reserve(SIMPLE_STACKSIZE); stack.reserve(SIMPLE_STACKSIZE);
stack.push_back(root); stack.push_back(root);
do { do {
const Node* n=stack[stack.size()-1]; const Node* n=stack[stack.size()-1];
stack.pop_back(); stack.pop_back();
if(Intersect(n->volume,volume)) if(Intersect(n->volume,volume))
{ {
if(n->isinternal()) if(n->isinternal())
{ {
stack.push_back(n->childs[0]); stack.push_back(n->childs[0]);
stack.push_back(n->childs[1]); stack.push_back(n->childs[1]);
} }
else else
{ {
policy.Process(n); policy.Process(n);
} }
} }
} while(stack.size()>0); } while(stack.size()>0);
} }
} }
// //
DBVT_PREFIX DBVT_PREFIX
inline void btDbvt::collideRAY( const Node* root, inline void btDbvt::collideRAY( const Node* root,
const btVector3& origin, const btVector3& origin,
const btVector3& direction, const btVector3& direction,
DBVT_IPOLICY) DBVT_IPOLICY)
{ {
DBVT_CHECKTYPE DBVT_CHECKTYPE
@@ -576,11 +580,11 @@ if(root)
} }
// //
DBVT_PREFIX DBVT_PREFIX
inline void btDbvt::collideKDOP(const Node* root, inline void btDbvt::collideKDOP(const Node* root,
const btVector3* normals, const btVector3* normals,
const btScalar* offsets, const btScalar* offsets,
int count, int count,
DBVT_IPOLICY) DBVT_IPOLICY)
{ {
DBVT_CHECKTYPE DBVT_CHECKTYPE
@@ -631,12 +635,12 @@ if(root)
} }
// //
DBVT_PREFIX DBVT_PREFIX
inline void btDbvt::collideOCL( const Node* root, inline void btDbvt::collideOCL( const Node* root,
const btVector3* normals, const btVector3* normals,
const btScalar* offsets, const btScalar* offsets,
const btVector3& sortaxis, const btVector3& sortaxis,
int count, int count,
DBVT_IPOLICY) DBVT_IPOLICY)
{ {
DBVT_CHECKTYPE DBVT_CHECKTYPE
@@ -734,6 +738,7 @@ if(root)
#ifdef DBVT_USE_TEMPLATE #ifdef DBVT_USE_TEMPLATE
#undef DBVT_USE_TEMPLATE #undef DBVT_USE_TEMPLATE
#endif #endif
#undef DBVT_VIRTUAL_DESTRUCTOR
#undef DBVT_VIRTUAL #undef DBVT_VIRTUAL
#undef DBVT_PREFIX #undef DBVT_PREFIX
#undef DBVT_IPOLICY #undef DBVT_IPOLICY

View File

@@ -334,4 +334,4 @@ void btDbvtBroadphase::printStats()
#if DBVT_BP_PROFILE #if DBVT_BP_PROFILE
#undef SPC #undef SPC
#endif #endif

View File

@@ -39,9 +39,9 @@ public:
btMultiSapBroadphase::btMultiSapBroadphase(int /*maxProxies*/,btOverlappingPairCache* pairCache) btMultiSapBroadphase::btMultiSapBroadphase(int /*maxProxies*/,btOverlappingPairCache* pairCache)
:m_overlappingPairs(pairCache), :m_overlappingPairs(pairCache),
m_optimizedAabbTree(0),
m_ownsPairCache(false), m_ownsPairCache(false),
m_invalidPair(0), m_invalidPair(0)
m_optimizedAabbTree(0)
{ {
if (!m_overlappingPairs) if (!m_overlappingPairs)
{ {

View File

@@ -491,9 +491,9 @@ void btSortedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback*
btSortedOverlappingPairCache::btSortedOverlappingPairCache(): btSortedOverlappingPairCache::btSortedOverlappingPairCache():
m_overlapFilterCallback(0),
m_blockedForChanges(false), m_blockedForChanges(false),
m_hasDeferredRemoval(true) m_hasDeferredRemoval(true),
m_overlapFilterCallback(0)
{ {
int initialAllocatedSize= 2; int initialAllocatedSize= 2;
m_overlappingPairArray.reserve(initialAllocatedSize); m_overlappingPairArray.reserve(initialAllocatedSize);

View File

@@ -21,9 +21,9 @@ subject to the following restrictions:
btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength,void* heightfieldData,btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges) btHeightfieldTerrainShape::btHeightfieldTerrainShape(int heightStickWidth, int heightStickLength,void* heightfieldData,btScalar maxHeight,int upAxis,bool useFloatData,bool flipQuadEdges)
: m_heightStickWidth(heightStickWidth), : m_heightStickWidth(heightStickWidth),
m_heightStickLength(heightStickLength), m_heightStickLength(heightStickLength),
m_maxHeight(maxHeight),
m_width((btScalar)heightStickWidth-1), m_width((btScalar)heightStickWidth-1),
m_length((btScalar)heightStickLength-1), m_length((btScalar)heightStickLength-1),
m_maxHeight(maxHeight),
m_heightfieldDataUnknown(heightfieldData), m_heightfieldDataUnknown(heightfieldData),
m_useFloatData(useFloatData), m_useFloatData(useFloatData),
m_flipQuadEdges(flipQuadEdges), m_flipQuadEdges(flipQuadEdges),

View File

@@ -14,7 +14,7 @@ subject to the following restrictions:
*/ */
#include "btTriangleMesh.h" #include "btTriangleMesh.h"
#include <assert.h>
btTriangleMesh::btTriangleMesh (bool use32bitIndices,bool use4componentVertices) btTriangleMesh::btTriangleMesh (bool use32bitIndices,bool use4componentVertices)

View File

@@ -159,4 +159,4 @@ btTriangleConvexcastCallback::processTriangle (btVector3* triangle, int partId,
} }
} }
} }
} }

View File

@@ -141,7 +141,7 @@ public:
SYS_TIMEBASE_GET( newTime ); SYS_TIMEBASE_GET( newTime );
//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory"); //__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
return (newTime-mStartTime) / dFreq; return (unsigned long int)((double(newTime-mStartTime)) / dFreq);
#else #else
struct timeval currentTime; struct timeval currentTime;
@@ -200,7 +200,7 @@ public:
//__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory"); //__asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
SYS_TIMEBASE_GET( newTime ); SYS_TIMEBASE_GET( newTime );
return (newTime-mStartTime) / dFreq; return (unsigned long int)((double(newTime-mStartTime)) / dFreq);
#else #else
struct timeval currentTime; struct timeval currentTime;