diff --git a/Demos/AllBulletDemos/Main.cpp b/Demos/AllBulletDemos/Main.cpp index 96032d90c..0b6b563fc 100644 --- a/Demos/AllBulletDemos/Main.cpp +++ b/Demos/AllBulletDemos/Main.cpp @@ -312,7 +312,7 @@ void SimulationLoop() for ( int i=0;igetSoftBodyArray().size();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::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags()); diff --git a/Demos/OpenCLClothDemo/clstuff.cpp b/Demos/OpenCLClothDemo/clstuff.cpp index eedd67413..2b7d41287 100644 --- a/Demos/OpenCLClothDemo/clstuff.cpp +++ b/Demos/OpenCLClothDemo/clstuff.cpp @@ -63,7 +63,7 @@ void initCL( void* glCtx, void* glDC ) break; default: - printf("createContextFromType(unknown device type %d\n",deviceType); + printf("createContextFromType(unknown device type %d\n",(int)deviceType); }; //#endif diff --git a/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp b/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp index 88e3d62e4..f1ae20f0c 100644 --- a/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp +++ b/Demos/ParticlesOpenCL/btParticlesDemoDynamicsWorld.cpp @@ -50,7 +50,7 @@ subject to the following restrictions: #define LOAD_FROM_MEMORY #ifdef LOAD_FROM_MEMORY #define MSTRINGIFY(A) #A -static char* source= +static const char* source= #include "ParticlesOCL.cl" #endif //LOAD_FROM_MEMORY @@ -363,7 +363,7 @@ void btParticlesDynamicsWorld::initCLKernels(int argc, char** argv) printf("OpenCL compiles ParticlesOCL.cl ... "); #else - char* fileName = "ParticlesOCL.cl"; + const char* fileName = "ParticlesOCL.cl"; FILE * fp = fopen(fileName, "rb"); char newFileName[512]; @@ -426,7 +426,7 @@ void btParticlesDynamicsWorld::initCLKernels(int argc, char** argv) // Build the program with 'mad' Optimization option #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 const char* flags = "-I. -DLOCAL_SIZE_MAX=1024U -DGUID_ARG= "; #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; diff --git a/Demos/ParticlesOpenCL/btParticlesDynamicsWorld.h b/Demos/ParticlesOpenCL/btParticlesDynamicsWorld.h index 682e840b9..66e99af37 100644 --- a/Demos/ParticlesOpenCL/btParticlesDynamicsWorld.h +++ b/Demos/ParticlesOpenCL/btParticlesDynamicsWorld.h @@ -78,7 +78,7 @@ struct btKernelInfo { int m_Id; cl_kernel m_kernel; - char* m_name; + const char* m_name; int m_workgroupSize; }; @@ -168,7 +168,7 @@ public: void runFindCellStartKernel(); void runCollideParticlesKernel(); - void initKernel(int kernelId, char* pName); + void initKernel(int kernelId, const char* pName); void runKernelWithWorkgroupSize(int kernelId, int globalSize); void bitonicSortNv(cl_mem pKey, unsigned int batch, unsigned int arrayLength, unsigned int dir); diff --git a/Demos/SerializeDemo/SerializeDemo.cpp b/Demos/SerializeDemo/SerializeDemo.cpp index cf628c9ee..120dc8da6 100644 --- a/Demos/SerializeDemo/SerializeDemo.cpp +++ b/Demos/SerializeDemo/SerializeDemo.cpp @@ -431,7 +431,6 @@ public: if (sbp && *sbp) { btSoftBody* sb = *sbp; - int i; for (int i=0;im_numJoints;i++) { btSoftBodyJointData* sbjoint = &softBodyData->m_joints[i]; @@ -625,7 +624,7 @@ void SerializeDemo::initPhysics() btDefaultSerializer* serializer = new btDefaultSerializer(maxSerializeBufferSize); - static char* groundName = "GroundName"; + static const char* groundName = "GroundName"; serializer->registerNameForPointer(groundObject, groundName); for (int i=0;i"); 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); - 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); - 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); - 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); - 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 clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(device_string), &device_string, NULL); diff --git a/Demos/SoftDemo/SoftDemo.cpp b/Demos/SoftDemo/SoftDemo.cpp index 4328259ea..59a343c5a 100644 --- a/Demos/SoftDemo/SoftDemo.cpp +++ b/Demos/SoftDemo/SoftDemo.cpp @@ -1539,11 +1539,16 @@ void SoftDemo::renderme() glDisable(GL_LIGHTING); m_dynamicsWorld->debugDrawWorld(); + int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1; + btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld; + btIDebugDraw* sdraw = softWorld ->getDebugDrawer(); + + for ( int i=0;igetSoftBodyArray().size();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::Draw(psb,softWorld->getDebugDrawer(),softWorld->getDrawFlags()); diff --git a/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp b/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp index cebbb7572..ab9fd7f1d 100644 --- a/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp +++ b/Demos/VectorAdd_OpenCL/MiniCL_VectorAdd.cpp @@ -29,10 +29,10 @@ size_t wgSize; #ifndef USE_MINICL #define MSTRINGIFY(A) #A -char* stringifiedSourceCL = +const char* stringifiedSourceCL = #include "VectorAddKernels.cl" #else -char* stringifiedSourceCL = ""; +const char* stringifiedSourceCL = ""; #endif @@ -103,7 +103,7 @@ void printDevInfo(cl_device_id device) // CL_DEVICE_MAX_WORK_GROUP_SIZE 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; #ifdef LOAD_FROM_FILE size_t szKernelLength; - char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength); + const char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength); #else - char* cSourceCL = stringifiedSourceCL; + const char* cSourceCL = stringifiedSourceCL; size_t szKernelLength = strlen(stringifiedSourceCL); #endif //LOAD_FROM_FILE diff --git a/Demos/VehicleDemo/VehicleDemo.cpp b/Demos/VehicleDemo/VehicleDemo.cpp index bbdea6b0c..2dfb990fd 100644 --- a/Demos/VehicleDemo/VehicleDemo.cpp +++ b/Demos/VehicleDemo/VehicleDemo.cpp @@ -87,11 +87,11 @@ btScalar suspensionRestLength(0.6); VehicleDemo::VehicleDemo() : m_carChassis(0), +m_indexVertexArrays(0), +m_vertices(0), m_cameraHeight(4.f), m_minCameraDistance(3.f), -m_maxCameraDistance(10.f), -m_indexVertexArrays(0), -m_vertices(0) +m_maxCameraDistance(10.f) { m_vehicle = 0; m_wheelShape = 0; diff --git a/Extras/glui/GL/glui.h b/Extras/glui/GL/glui.h index b2229415d..2deb9dc45 100644 --- a/Extras/glui/GL/glui.h +++ b/Extras/glui/GL/glui.h @@ -2155,7 +2155,7 @@ public: void set_text( const char *text ); 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_start_line(int l) { start_line = l; } static void scrollbar_callback(GLUI_Control*); diff --git a/Extras/glui/glui_edittext.cpp b/Extras/glui/glui_edittext.cpp index 1241033e0..9066fde6c 100644 --- a/Extras/glui/glui_edittext.cpp +++ b/Extras/glui/glui_edittext.cpp @@ -931,7 +931,7 @@ int GLUI_EditText::special_handler( int key,int modifiers ) int GLUI_EditText::find_word_break( int start, int direction ) { int i, j; - char *breaks = " :-.,"; + const char *breaks = " :-.,"; int num_break_chars = (int)strlen(breaks), text_len = (int)text.length(); int new_pt; diff --git a/Extras/glui/glui_textbox.cpp b/Extras/glui/glui_textbox.cpp index 9bf042658..342e0091d 100644 --- a/Extras/glui/glui_textbox.cpp +++ b/Extras/glui/glui_textbox.cpp @@ -1065,10 +1065,10 @@ void GLUI_TextBox::set_text( const char *new_text ) /*************************************** GLUI_TextBox::dump() **************/ -void GLUI_TextBox::dump( FILE *out, char *name ) +void GLUI_TextBox::dump( FILE *out, const char *name ) { 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, insertion_pt, substring_start, substring_end, sel_start, sel_end, text.length()); diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp index aab53bad2..ee64dc677 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -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()) diff --git a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp index 5acd0daee..9e3a2baee 100644 --- a/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -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 diff --git a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp index fb77b1c53..5ca6f16d0 100644 --- a/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp +++ b/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp @@ -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) { } diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 9b39e6802..b006c67b1 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -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; diff --git a/src/BulletMultiThreaded/PosixThreadSupport.h b/src/BulletMultiThreaded/PosixThreadSupport.h index 2df3f0e6d..ca47e450f 100644 --- a/src/BulletMultiThreaded/PosixThreadSupport.h +++ b/src/BulletMultiThreaded/PosixThreadSupport.h @@ -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; diff --git a/src/BulletMultiThreaded/SequentialThreadSupport.h b/src/BulletMultiThreaded/SequentialThreadSupport.h index c750f7f24..2b9ade82a 100644 --- a/src/BulletMultiThreaded/SequentialThreadSupport.h +++ b/src/BulletMultiThreaded/SequentialThreadSupport.h @@ -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; }; diff --git a/src/BulletMultiThreaded/Win32ThreadSupport.h b/src/BulletMultiThreaded/Win32ThreadSupport.h index 4370c00e3..abf5d21e5 100644 --- a/src/BulletMultiThreaded/Win32ThreadSupport.h +++ b/src/BulletMultiThreaded/Win32ThreadSupport.h @@ -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; diff --git a/src/BulletSoftBody/btSoftBody.cpp b/src/BulletSoftBody/btSoftBody.cpp index 877004d79..4036877b1 100644 --- a/src/BulletSoftBody/btSoftBody.cpp +++ b/src/BulletSoftBody/btSoftBody.cpp @@ -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(); diff --git a/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp b/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp index 04ee7ea77..d99be3b81 100644 --- a/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp +++ b/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp @@ -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(); diff --git a/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp b/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp index 12381031f..8f4be231c 100644 --- a/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp +++ b/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp @@ -165,7 +165,7 @@ void btSoftRigidDynamicsWorld::debugDrawWorld() for ( i=0;im_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); diff --git a/src/MiniCL/MiniCL.cpp b/src/MiniCL/MiniCL.cpp index 424d6fb8b..4307f63ca 100644 --- a/src/MiniCL/MiniCL.cpp +++ b/src/MiniCL/MiniCL.cpp @@ -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, diff --git a/src/MiniCL/MiniCLTaskScheduler.cpp b/src/MiniCL/MiniCLTaskScheduler.cpp index 7adee88d2..18cf64576 100644 --- a/src/MiniCL/MiniCLTaskScheduler.cpp +++ b/src/MiniCL/MiniCLTaskScheduler.cpp @@ -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++) { diff --git a/src/MiniCL/cl_platform.h b/src/MiniCL/cl_platform.h index 3d372e305..43219e141 100644 --- a/src/MiniCL/cl_platform.h +++ b/src/MiniCL/cl_platform.h @@ -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);