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;
@@ -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

@@ -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

@@ -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;