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

@@ -312,7 +312,7 @@ void SimulationLoop()
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++) for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
{ {
btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i]; btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i];
if (softWorld->getDebugDrawer() && !softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)) if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
{ {
btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer()); btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags()); btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());

View File

@@ -63,7 +63,7 @@ void initCL( void* glCtx, void* glDC )
break; break;
default: default:
printf("createContextFromType(unknown device type %d\n",deviceType); printf("createContextFromType(unknown device type %d\n",(int)deviceType);
}; };
//#endif //#endif

View File

@@ -50,7 +50,7 @@ subject to the following restrictions:
#define LOAD_FROM_MEMORY #define LOAD_FROM_MEMORY
#ifdef LOAD_FROM_MEMORY #ifdef LOAD_FROM_MEMORY
#define MSTRINGIFY(A) #A #define MSTRINGIFY(A) #A
static char* source= static const char* source=
#include "ParticlesOCL.cl" #include "ParticlesOCL.cl"
#endif //LOAD_FROM_MEMORY #endif //LOAD_FROM_MEMORY
@@ -363,7 +363,7 @@ void btParticlesDynamicsWorld::initCLKernels(int argc, char** argv)
printf("OpenCL compiles ParticlesOCL.cl ... "); printf("OpenCL compiles ParticlesOCL.cl ... ");
#else #else
char* fileName = "ParticlesOCL.cl"; const char* fileName = "ParticlesOCL.cl";
FILE * fp = fopen(fileName, "rb"); FILE * fp = fopen(fileName, "rb");
char newFileName[512]; char newFileName[512];
@@ -426,7 +426,7 @@ void btParticlesDynamicsWorld::initCLKernels(int argc, char** argv)
// Build the program with 'mad' Optimization option // Build the program with 'mad' Optimization option
#ifdef MAC #ifdef MAC
char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -cl-mad-enable -DMAC -DGUID_ARG"; const char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -cl-mad-enable -DMAC -DGUID_ARG";
#else #else
const char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -DGUID_ARG= "; const char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -DGUID_ARG= ";
#endif #endif
@@ -1024,7 +1024,7 @@ void btParticlesDynamicsWorld::runFindCellStartKernel()
} }
void btParticlesDynamicsWorld::initKernel(int kernelId, char* pName) void btParticlesDynamicsWorld::initKernel(int kernelId, const char* pName)
{ {
cl_int ciErrNum; cl_int ciErrNum;

View File

@@ -78,7 +78,7 @@ struct btKernelInfo
{ {
int m_Id; int m_Id;
cl_kernel m_kernel; cl_kernel m_kernel;
char* m_name; const char* m_name;
int m_workgroupSize; int m_workgroupSize;
}; };
@@ -168,7 +168,7 @@ public:
void runFindCellStartKernel(); void runFindCellStartKernel();
void runCollideParticlesKernel(); void runCollideParticlesKernel();
void initKernel(int kernelId, char* pName); void initKernel(int kernelId, const char* pName);
void runKernelWithWorkgroupSize(int kernelId, int globalSize); void runKernelWithWorkgroupSize(int kernelId, int globalSize);
void bitonicSortNv(cl_mem pKey, unsigned int batch, unsigned int arrayLength, unsigned int dir); void bitonicSortNv(cl_mem pKey, unsigned int batch, unsigned int arrayLength, unsigned int dir);

View File

@@ -431,7 +431,6 @@ public:
if (sbp && *sbp) if (sbp && *sbp)
{ {
btSoftBody* sb = *sbp; btSoftBody* sb = *sbp;
int i;
for (int i=0;i<softBodyData->m_numJoints;i++) for (int i=0;i<softBodyData->m_numJoints;i++)
{ {
btSoftBodyJointData* sbjoint = &softBodyData->m_joints[i]; btSoftBodyJointData* sbjoint = &softBodyData->m_joints[i];
@@ -625,7 +624,7 @@ void SerializeDemo::initPhysics()
btDefaultSerializer* serializer = new btDefaultSerializer(maxSerializeBufferSize); btDefaultSerializer* serializer = new btDefaultSerializer(maxSerializeBufferSize);
static char* groundName = "GroundName"; static const char* groundName = "GroundName";
serializer->registerNameForPointer(groundObject, groundName); serializer->registerNameForPointer(groundObject, groundName);
for (int i=0;i<m_collisionShapes.size();i++) for (int i=0;i<m_collisionShapes.size();i++)

View File

@@ -18,7 +18,7 @@ subject to the following restrictions:
#include "btOclCommon.h" #include "btOclCommon.h"
static char* spPlatformVendor = static const char* spPlatformVendor =
#if defined(CL_PLATFORM_MINI_CL) #if defined(CL_PLATFORM_MINI_CL)
"MiniCL, SCEA"; "MiniCL, SCEA";
#elif defined(CL_PLATFORM_INTEL) #elif defined(CL_PLATFORM_INTEL)

View File

@@ -255,17 +255,17 @@ void btOclPrintDevInfo(cl_device_id device)
// CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS // CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
size_t workitem_dims; size_t workitem_dims;
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(workitem_dims), &workitem_dims, NULL); clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(workitem_dims), &workitem_dims, NULL);
printf(" CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:\t%u\n", workitem_dims); printf(" CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:\t%zu\n", workitem_dims);
// CL_DEVICE_MAX_WORK_ITEM_SIZES // CL_DEVICE_MAX_WORK_ITEM_SIZES
size_t workitem_size[3]; size_t workitem_size[3];
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL); clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL);
printf(" CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%u / %u / %u \n", workitem_size[0], workitem_size[1], workitem_size[2]); printf(" CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%zu / %zu / %zu \n", workitem_size[0], workitem_size[1], workitem_size[2]);
// CL_DEVICE_MAX_WORK_GROUP_SIZE // CL_DEVICE_MAX_WORK_GROUP_SIZE
size_t workgroup_size; size_t workgroup_size;
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(workgroup_size), &workgroup_size, NULL); clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(workgroup_size), &workgroup_size, NULL);
printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE:\t%u\n", workgroup_size); printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE:\t%zu\n", workgroup_size);
// CL_DEVICE_MAX_CLOCK_FREQUENCY // CL_DEVICE_MAX_CLOCK_FREQUENCY
cl_uint clock_frequency; cl_uint clock_frequency;
@@ -332,15 +332,15 @@ void btOclPrintDevInfo(cl_device_id device)
size_t szMaxDims[5]; size_t szMaxDims[5];
printf("\n CL_DEVICE_IMAGE <dim>"); printf("\n CL_DEVICE_IMAGE <dim>");
clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof(size_t), &szMaxDims[0], NULL); clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_WIDTH, sizeof(size_t), &szMaxDims[0], NULL);
printf("\t\t\t2D_MAX_WIDTH\t %u\n", szMaxDims[0]); printf("\t\t\t2D_MAX_WIDTH\t %zu\n", szMaxDims[0]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[1], NULL); clGetDeviceInfo(device, CL_DEVICE_IMAGE2D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[1], NULL);
printf("\t\t\t\t\t2D_MAX_HEIGHT\t %u\n", szMaxDims[1]); printf("\t\t\t\t\t2D_MAX_HEIGHT\t %zu\n", szMaxDims[1]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(size_t), &szMaxDims[2], NULL); clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_WIDTH, sizeof(size_t), &szMaxDims[2], NULL);
printf("\t\t\t\t\t3D_MAX_WIDTH\t %u\n", szMaxDims[2]); printf("\t\t\t\t\t3D_MAX_WIDTH\t %zu\n", szMaxDims[2]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[3], NULL); clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_HEIGHT, sizeof(size_t), &szMaxDims[3], NULL);
printf("\t\t\t\t\t3D_MAX_HEIGHT\t %u\n", szMaxDims[3]); printf("\t\t\t\t\t3D_MAX_HEIGHT\t %zu\n", szMaxDims[3]);
clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(size_t), &szMaxDims[4], NULL); clGetDeviceInfo(device, CL_DEVICE_IMAGE3D_MAX_DEPTH, sizeof(size_t), &szMaxDims[4], NULL);
printf("\t\t\t\t\t3D_MAX_DEPTH\t %u\n", szMaxDims[4]); printf("\t\t\t\t\t3D_MAX_DEPTH\t %zu\n", szMaxDims[4]);
// CL_DEVICE_EXTENSIONS: get device extensions, and if any then parse & log the string onto separate lines // CL_DEVICE_EXTENSIONS: get device extensions, and if any then parse & log the string onto separate lines
clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(device_string), &device_string, NULL); clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(device_string), &device_string, NULL);

View File

@@ -1539,11 +1539,16 @@ void SoftDemo::renderme()
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
m_dynamicsWorld->debugDrawWorld(); m_dynamicsWorld->debugDrawWorld();
int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld; btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++) for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
{ {
btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i]; btSoftBody* psb=(btSoftBody*)softWorld->getSoftBodyArray()[i];
if (softWorld->getDebugDrawer() && !softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)) if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)))
{ {
btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer()); btSoftBodyHelpers::DrawFrame(psb,softWorld->getDebugDrawer());
btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags()); btSoftBodyHelpers::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags());

View File

@@ -29,10 +29,10 @@ size_t wgSize;
#ifndef USE_MINICL #ifndef USE_MINICL
#define MSTRINGIFY(A) #A #define MSTRINGIFY(A) #A
char* stringifiedSourceCL = const char* stringifiedSourceCL =
#include "VectorAddKernels.cl" #include "VectorAddKernels.cl"
#else #else
char* stringifiedSourceCL = ""; const char* stringifiedSourceCL = "";
#endif #endif
@@ -103,7 +103,7 @@ void printDevInfo(cl_device_id device)
// CL_DEVICE_MAX_WORK_GROUP_SIZE // CL_DEVICE_MAX_WORK_GROUP_SIZE
clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL); clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(workitem_size), &workitem_size, NULL);
printf( " CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%d / %d / %d \n", workitem_size[0], workitem_size[1], workitem_size[2]); printf( " CL_DEVICE_MAX_WORK_ITEM_SIZES:\t%zu / %zu / %zu \n", workitem_size[0], workitem_size[1], workitem_size[2]);
} }
@@ -226,9 +226,9 @@ int main(int argc, char **argv)
const char* cPathAndName = cSourceFile; const char* cPathAndName = cSourceFile;
#ifdef LOAD_FROM_FILE #ifdef LOAD_FROM_FILE
size_t szKernelLength; size_t szKernelLength;
char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength); const char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength);
#else #else
char* cSourceCL = stringifiedSourceCL; const char* cSourceCL = stringifiedSourceCL;
size_t szKernelLength = strlen(stringifiedSourceCL); size_t szKernelLength = strlen(stringifiedSourceCL);
#endif //LOAD_FROM_FILE #endif //LOAD_FROM_FILE

View File

@@ -87,11 +87,11 @@ btScalar suspensionRestLength(0.6);
VehicleDemo::VehicleDemo() VehicleDemo::VehicleDemo()
: :
m_carChassis(0), m_carChassis(0),
m_indexVertexArrays(0),
m_vertices(0),
m_cameraHeight(4.f), m_cameraHeight(4.f),
m_minCameraDistance(3.f), m_minCameraDistance(3.f),
m_maxCameraDistance(10.f), m_maxCameraDistance(10.f)
m_indexVertexArrays(0),
m_vertices(0)
{ {
m_vehicle = 0; m_vehicle = 0;
m_wheelShape = 0; m_wheelShape = 0;

View File

@@ -2155,7 +2155,7 @@ public:
void set_text( const char *text ); void set_text( const char *text );
const char *get_text( void ) { return text.c_str(); } const char *get_text( void ) { return text.c_str(); }
void dump( FILE *out, char *text ); void dump( FILE *out, const char *text );
void set_tab_w(int w) { tab_width = w; } void set_tab_w(int w) { tab_width = w; }
void set_start_line(int l) { start_line = l; } void set_start_line(int l) { start_line = l; }
static void scrollbar_callback(GLUI_Control*); static void scrollbar_callback(GLUI_Control*);

View File

@@ -931,7 +931,7 @@ int GLUI_EditText::special_handler( int key,int modifiers )
int GLUI_EditText::find_word_break( int start, int direction ) int GLUI_EditText::find_word_break( int start, int direction )
{ {
int i, j; int i, j;
char *breaks = " :-.,"; const char *breaks = " :-.,";
int num_break_chars = (int)strlen(breaks), text_len = (int)text.length(); int num_break_chars = (int)strlen(breaks), text_len = (int)text.length();
int new_pt; int new_pt;

View File

@@ -1065,10 +1065,10 @@ void GLUI_TextBox::set_text( const char *new_text )
/*************************************** GLUI_TextBox::dump() **************/ /*************************************** GLUI_TextBox::dump() **************/
void GLUI_TextBox::dump( FILE *out, char *name ) void GLUI_TextBox::dump( FILE *out, const char *name )
{ {
fprintf( out, fprintf( out,
"%s (edittext@%p): line:%d ins_pt:%d subs:%d/%d sel:%d/%d len:%d\n", "%s (edittext@%p): line:%d ins_pt:%d subs:%d/%d sel:%d/%d len:%zu\n",
name, this, curr_line, name, this, curr_line,
insertion_pt, substring_start, substring_end, sel_start, sel_end, insertion_pt, substring_start, substring_end, sel_start, sel_end,
text.length()); text.length());

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; int i;
@@ -1423,7 +1423,7 @@ void btCollisionWorld::debugDrawWorld()
btCollisionObject* colObj = m_collisionObjects[i]; btCollisionObject* colObj = m_collisionObjects[i];
if ((colObj->getCollisionFlags() & btCollisionObject::CF_DISABLE_VISUALIZE_OBJECT)==0) 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.)); btVector3 color(btScalar(1.),btScalar(1.),btScalar(1.));
switch(colObj->getActivationState()) 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, btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB,
const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA) const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB), :btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false), m_angularOnly(false),
m_enableAngularMotor(false), m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER), m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET), m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA), m_useReferenceFrameA(useReferenceFrameA),
m_flags(0) m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{ {
m_rbAFrame.getOrigin() = pivotInA; 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) 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_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET), m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA), m_useReferenceFrameA(useReferenceFrameA),
m_flags(0) 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 // 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, btHingeConstraint::btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB,
const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA) const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame), :btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA,rbB),m_rbAFrame(rbAFrame),m_rbBFrame(rbBFrame),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false), m_angularOnly(false),
m_enableAngularMotor(false), m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER), m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET), m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA), m_useReferenceFrameA(useReferenceFrameA),
m_flags(0) m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{ {
#ifndef _BT_USE_CENTER_LIMIT_ #ifndef _BT_USE_CENTER_LIMIT_
//start with free //start with free
@@ -168,15 +169,15 @@ m_flags(0)
btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame, bool useReferenceFrameA) btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFrame, bool useReferenceFrameA)
:btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame), :btTypedConstraint(HINGE_CONSTRAINT_TYPE, rbA),m_rbAFrame(rbAFrame),m_rbBFrame(rbAFrame),
#ifdef _BT_USE_CENTER_LIMIT_
m_limit(),
#endif
m_angularOnly(false), m_angularOnly(false),
m_enableAngularMotor(false), m_enableAngularMotor(false),
m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER), m_useSolveConstraintObsolete(HINGE_USE_OBSOLETE_SOLVER),
m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET), m_useOffsetForConstraintFrame(HINGE_USE_FRAME_OFFSET),
m_useReferenceFrameA(useReferenceFrameA), m_useReferenceFrameA(useReferenceFrameA),
m_flags(0) m_flags(0)
#ifdef _BT_USE_CENTER_LIMIT_
,m_limit()
#endif
{ {
///not providing rigidbody B means implicitly using worldspace for body B ///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), :btTypedObject(type),
m_userConstraintType(-1), m_userConstraintType(-1),
m_userConstraintId(-1), m_userConstraintId(-1),
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true),
m_needsFeedback(false), m_needsFeedback(false),
m_rbA(rbA), m_rbA(rbA),
m_rbB(getFixedBody()), m_rbB(getFixedBody()),
m_appliedImpulse(btScalar(0.)), m_appliedImpulse(btScalar(0.)),
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE), m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true)
{ {
} }
@@ -40,13 +40,13 @@ btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rb
:btTypedObject(type), :btTypedObject(type),
m_userConstraintType(-1), m_userConstraintType(-1),
m_userConstraintId(-1), m_userConstraintId(-1),
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true),
m_needsFeedback(false), m_needsFeedback(false),
m_rbA(rbA), m_rbA(rbA),
m_rbB(rbB), m_rbB(rbB),
m_appliedImpulse(btScalar(0.)), m_appliedImpulse(btScalar(0.)),
m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE), m_dbgDrawSize(DEFAULT_DEBUGDRAW_SIZE)
m_breakingImpulseThreshold(SIMD_INFINITY),
m_isEnabled(true)
{ {
} }

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; int i;

View File

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

View File

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

View File

@@ -66,7 +66,7 @@ public:
struct Win32ThreadConstructionInfo struct Win32ThreadConstructionInfo
{ {
Win32ThreadConstructionInfo(char* uniqueName, Win32ThreadConstructionInfo(const char* uniqueName,
Win32ThreadFunc userThreadFunc, Win32ThreadFunc userThreadFunc,
Win32lsMemorySetupFunc lsMemoryFunc, Win32lsMemorySetupFunc lsMemoryFunc,
int numThreads=1, int numThreads=1,
@@ -81,7 +81,7 @@ public:
} }
char* m_uniqueName; const char* m_uniqueName;
Win32ThreadFunc m_userThreadFunc; Win32ThreadFunc m_userThreadFunc;
Win32lsMemorySetupFunc m_lsMemoryFunc; Win32lsMemorySetupFunc m_lsMemoryFunc;
int m_numThreads; 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) 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 */ /* Init */
initDefaults(); initDefaults();

View File

@@ -95,7 +95,7 @@ void btSoftBodyTriangleCallback::processTriangle(btVector3* triangle,int partId,
ci.m_dispatcher1 = m_dispatcher; ci.m_dispatcher1 = m_dispatcher;
///debug drawing of the overlapping triangles ///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); btVector3 color(1,1,0);
btTransform& tr = ob->getWorldTransform(); btTransform& tr = ob->getWorldTransform();

View File

@@ -165,7 +165,7 @@ void btSoftRigidDynamicsWorld::debugDrawWorld()
for ( i=0;i<this->m_softBodies.size();i++) for ( i=0;i<this->m_softBodies.size();i++)
{ {
btSoftBody* psb=(btSoftBody*)this->m_softBodies[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::DrawFrame(psb,m_debugDrawer);
btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags); btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags);

View File

@@ -35,8 +35,8 @@ subject to the following restrictions:
//#define DEBUG_MINICL_KERNELS 1 //#define DEBUG_MINICL_KERNELS 1
static char* spPlatformID = "MiniCL, SCEA"; static const char* spPlatformID = "MiniCL, SCEA";
static char* spDriverVersion= "1.0"; static const char* spDriverVersion= "1.0";
CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs( CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs(
cl_uint num_entries, cl_uint num_entries,
@@ -49,7 +49,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetPlatformIDs(
{ {
return CL_INVALID_VALUE; return CL_INVALID_VALUE;
} }
*((char**)platforms) = spPlatformID; *((const char**)platforms) = spPlatformID;
} }
if(num_platforms != NULL) if(num_platforms != NULL)
{ {
@@ -106,7 +106,7 @@ CL_API_ENTRY cl_int CL_API_CALL clGetDeviceInfo(
case CL_DEVICE_NAME: case CL_DEVICE_NAME:
{ {
char deviceName[] = "MiniCL CPU"; char deviceName[] = "MiniCL CPU";
unsigned int nameLen = strlen(deviceName)+1; unsigned int nameLen = (unsigned int)strlen(deviceName)+1;
btAssert(param_value_size>strlen(deviceName)); btAssert(param_value_size>strlen(deviceName));
if (nameLen < param_value_size) 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); btAssert(arg_size <= MINICL_MAX_ARGLENGTH);
if (arg_index>MINI_CL_MAX_ARG) 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 } else
{ {
if (arg_size>MINICL_MAX_ARGLENGTH) if (arg_size>MINICL_MAX_ARGLENGTH)
//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 else
{ {
@@ -644,7 +644,7 @@ CL_API_ENTRY cl_context CL_API_CALL clCreateContextFromType(cl_context_propertie
gMiniCLNumOutstandingTasks = maxNumOutstandingTasks; gMiniCLNumOutstandingTasks = maxNumOutstandingTasks;
const int maxNumOfThreadSupports = 8; const int maxNumOfThreadSupports = 8;
static int sUniqueThreadSupportIndex = 0; 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" "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 #if _WIN32
btAssert(sUniqueThreadSupportIndex < maxNumOfThreadSupports); btAssert(sUniqueThreadSupportIndex < maxNumOfThreadSupports);
const char* bla = "MiniCL";
threadSupport = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo( threadSupport = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
// "MiniCL", // bla,
sUniqueThreadSupportName[sUniqueThreadSupportIndex++], sUniqueThreadSupportName[sUniqueThreadSupportIndex++],
processMiniCLTask, //processCollisionTask, processMiniCLTask, //processCollisionTask,
createMiniCLLocalStoreMemory,//createCollisionLocalStoreMemory, createMiniCLLocalStoreMemory,//createCollisionLocalStoreMemory,

View File

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

View File

@@ -28,7 +28,7 @@
struct MiniCLKernelDesc 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); #define MINICL_REGISTER(__kernel_func) static MiniCLKernelDesc __kernel_func##Desc((void*)__kernel_func, #__kernel_func);