Fix a lot of warnings, thanks to ejtttje, Fixes issue 537

Fix soft body debug rendering
This commit is contained in:
erwin.coumans
2011-09-15 01:17:34 +00:00
parent 0c01816375
commit a13d22dc84
26 changed files with 80 additions and 74 deletions

View File

@@ -1414,7 +1414,7 @@ void btCollisionWorld::debugDrawWorld()
}
}
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb)))
{
int i;
@@ -1423,7 +1423,7 @@ void btCollisionWorld::debugDrawWorld()
btCollisionObject* colObj = m_collisionObjects[i];
if ((colObj->getCollisionFlags() & btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT)==0)
{
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe)
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & btIDebugDraw::DBG_DrawWireframe))
{
btVector3 color(btScalar(1.),btScalar(1.),btScalar(1.));
switch(colObj->getActivationState())

View File

@@ -37,15 +37,15 @@ subject to the following restrictions:
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB,
const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false),
m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA),
m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{
m_rbAFrame.getOrigin() = pivotInA;
@@ -93,14 +93,15 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const bt
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA), m_angularOnly(false), m_enableAngularMotor(false),
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false), m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA),
m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{
// since no frame is given, assume this to be zero angle and just pick rb transform axis
@@ -142,15 +143,15 @@ m_flags(0)
btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB,
const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false),
m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA),
m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{
#ifndef _BT_USE_CENTER_LIMIT_
//start with free
@@ -168,15 +169,15 @@ m_flags(0)
btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false),
m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA),
m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{
///not providing rigidbody B means implicitly using worldspace for body B

View File

@@ -25,13 +25,13 @@ btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rb
:btTypedObject(type),
m_userConstraintType(-1),
m_userConstraintId(-1),
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true),
m_needsFeedback(false),
m_rbA(rbA),
m_rbB(getFixedBody()),
m_appliedImpulse(btScalar(0.)),
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true)
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
{
}
@@ -40,13 +40,13 @@ btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rb
:btTypedObject(type),
m_userConstraintType(-1),
m_userConstraintId(-1),
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true),
m_needsFeedback(false),
m_rbA(rbA),
m_rbB(rbB),
m_appliedImpulse(btScalar(0.)),
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE),
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true)
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
{
}

View File

@@ -147,7 +147,7 @@ void btDiscreteDynamicsWorld::debugDrawWorld()
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb))
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb)))
{
int i;

View File

@@ -74,7 +74,7 @@ public:
struct ThreadConstructionInfo
{
ThreadConstructionInfo(char* uniqueName,
ThreadConstructionInfo(const char* uniqueName,
PosixThreadFunc userThreadFunc,
PosixlsMemorySetupFunc lsMemoryFunc,
int numThreads=1,
@@ -89,7 +89,7 @@ public:
}
char* m_uniqueName;
const char* m_uniqueName;
PosixThreadFunc m_userThreadFunc;
PosixlsMemorySetupFunc m_lsMemoryFunc;
int m_numThreads;

View File

@@ -51,7 +51,7 @@ private:
public:
struct SequentialThreadConstructionInfo
{
SequentialThreadConstructionInfo (char* uniqueName,
SequentialThreadConstructionInfo (const char* uniqueName,
SequentialThreadFunc userThreadFunc,
SequentiallsMemorySetupFunc lsMemoryFunc
)
@@ -62,7 +62,7 @@ public:
}
char* m_uniqueName;
const char* m_uniqueName;
SequentialThreadFunc m_userThreadFunc;
SequentiallsMemorySetupFunc m_lsMemoryFunc;
};

View File

@@ -66,7 +66,7 @@ public:
struct Win32ThreadConstructionInfo
{
Win32ThreadConstructionInfo(char* uniqueName,
Win32ThreadConstructionInfo(const char* uniqueName,
Win32ThreadFunc userThreadFunc,
Win32lsMemorySetupFunc lsMemoryFunc,
int numThreads=1,
@@ -81,7 +81,7 @@ public:
}
char* m_uniqueName;
const char* m_uniqueName;
Win32ThreadFunc m_userThreadFunc;
Win32lsMemorySetupFunc m_lsMemoryFunc;
int m_numThreads;

View File

@@ -22,7 +22,7 @@ subject to the following restrictions:
//
btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo,int node_count, const btVector3* x, const btScalar* m)
:m_worldInfo(worldInfo),m_softBodySolver(0)
:m_softBodySolver(0),m_worldInfo(worldInfo)
{
/* Init */
initDefaults();

View File

@@ -95,7 +95,7 @@ void btSoftBodyTriangleCallback::processTriangle(btVector3* triangle,int partId,
ci.m_dispatcher1 = m_dispatcher;
///debug drawing of the overlapping triangles
if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe)
if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe))
{
btVector3 color(1,1,0);
btTransform& tr = ob->getWorldTransform();

View File

@@ -165,7 +165,7 @@ void btSoftRigidDynamicsWorld::debugDrawWorld()
for ( i=0;i<this->m_softBodies.size();i++)
{
btSoftBody* psb=(btSoftBody*)this->m_softBodies[i];
if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))
if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
{
btSoftBodyHelpers::DrawFrame(psb,m_debugDrawer);
btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags);

View File

@@ -35,8 +35,8 @@ subject to the following restrictions:
//#define DEBUG_MINICL_KERNELS 1
static char* spPlatformID = "MiniCL, SCEA";
static char* spDriverVersion= "1.0";
static const char* spPlatformID = "MiniCL, SCEA";
static const char* spDriverVersion= "1.0";
CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs(
cl_uint num_entries,
@@ -49,7 +49,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs(
{
return CL_INVALID_VALUE;
}
*((char**)platforms) = spPlatformID;
*((const char**)platforms) = spPlatformID;
}
if(num_platforms != NULL)
{
@@ -106,7 +106,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetDeviceInfo(
case CL_DEVICE_NAME:
{
char deviceName[] = "MiniCL CPU";
unsigned int nameLen = strlen(deviceName)+1;
unsigned int nameLen = (unsigned int)strlen(deviceName)+1;
btAssert(param_value_size>strlen(deviceName));
if (nameLen < param_value_size)
{
@@ -484,13 +484,13 @@ CL_API_ENTRY cl_int CL_API_CALL clSetKernelArg(cl_kernel clKernel ,
btAssert(arg_size <= MINICL_MAX_ARGLENGTH);
if (arg_index>MINI_CL_MAX_ARG)
{
printf("error: clSetKernelArg arg_index (%d) exceeds %d\n",arg_index,MINI_CL_MAX_ARG);
printf("error: clSetKernelArg arg_index (%u) exceeds %u\n",arg_index,MINI_CL_MAX_ARG);
} else
{
if (arg_size>MINICL_MAX_ARGLENGTH)
//if (arg_size != MINICL_MAX_ARGLENGTH)
{
printf("error: clSetKernelArg argdata too large: %d (maximum is %d)\n",arg_size,MINICL_MAX_ARGLENGTH);
printf("error: clSetKernelArg argdata too large: %zu (maximum is %zu)\n",arg_size,MINICL_MAX_ARGLENGTH);
}
else
{
@@ -644,7 +644,7 @@ CL_API_ENTRY cl_context CL_API_CALL clCreateContextFromType(cl_context_propertie
gMiniCLNumOutstandingTasks = maxNumOutstandingTasks;
const int maxNumOfThreadSupports = 8;
static int sUniqueThreadSupportIndex = 0;
static char* sUniqueThreadSupportName[maxNumOfThreadSupports] =
static const char* sUniqueThreadSupportName[maxNumOfThreadSupports] =
{
"MiniCL_0", "MiniCL_1", "MiniCL_2", "MiniCL_3", "MiniCL_4", "MiniCL_5", "MiniCL_6", "MiniCL_7"
};
@@ -660,8 +660,9 @@ CL_API_ENTRY cl_context CL_API_CALL clCreateContextFromType(cl_context_propertie
#if _WIN32
btAssert(sUniqueThreadSupportIndex < maxNumOfThreadSupports);
const char* bla = "MiniCL";
threadSupport = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
// "MiniCL",
// bla,
sUniqueThreadSupportName[sUniqueThreadSupportIndex++],
processMiniCLTask, //processCollisionTask,
createMiniCLLocalStoreMemory,//createCollisionLocalStoreMemory,

View File

@@ -478,12 +478,12 @@ void MiniCLKernel::updateLauncher()
struct MiniCLKernelDescEntry
{
void* pCode;
char* pName;
const char* pName;
};
static MiniCLKernelDescEntry spKernelDesc[256];
static int sNumKernelDesc = 0;
MiniCLKernelDesc::MiniCLKernelDesc(void* pCode, char* pName)
MiniCLKernelDesc::MiniCLKernelDesc(void* pCode, const char* pName)
{
for(int i = 0; i < sNumKernelDesc; i++)
{

View File

@@ -28,7 +28,7 @@
struct MiniCLKernelDesc
{
MiniCLKernelDesc(void* pCode, char* pName);
MiniCLKernelDesc(void* pCode, const char* pName);
};
#define MINICL_REGISTER(__kernel_func) static MiniCLKernelDesc __kernel_func##Desc((void*)__kernel_func, #__kernel_func);