diff --git a/Extras/HACD/hacdHACD.h b/Extras/HACD/hacdHACD.h index 5bb692d83..732ace784 100644 --- a/Extras/HACD/hacdHACD.h +++ b/Extras/HACD/hacdHACD.h @@ -22,6 +22,7 @@ #include #include #include +#include namespace HACD { diff --git a/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h index 32e8f032c..bb58b8289 100644 --- a/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h +++ b/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h @@ -246,7 +246,7 @@ class btBroadphasePairSortPredicate { public: - bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b ) + bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b ) const { const int uidA0 = a.m_pProxy0 ? a.m_pProxy0->m_uniqueId : -1; const int uidB0 = b.m_pProxy0 ? b.m_pProxy0->m_uniqueId : -1; diff --git a/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp b/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp index 6712f528e..81369fe9b 100644 --- a/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp +++ b/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp @@ -341,7 +341,7 @@ class btMultiSapBroadphasePairSortPredicate { public: - bool operator() ( const btBroadphasePair& a1, const btBroadphasePair& b1 ) + bool operator() ( const btBroadphasePair& a1, const btBroadphasePair& b1 ) const { btMultiSapBroadphase::btMultiSapProxy* aProxy0 = a1.m_pProxy0 ? (btMultiSapBroadphase::btMultiSapProxy*)a1.m_pProxy0->m_multiSapParentProxy : 0; btMultiSapBroadphase::btMultiSapProxy* aProxy1 = a1.m_pProxy1 ? (btMultiSapBroadphase::btMultiSapProxy*)a1.m_pProxy1->m_multiSapParentProxy : 0; diff --git a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp index e8950a9b8..8b114192b 100644 --- a/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp +++ b/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp @@ -193,7 +193,7 @@ class btPersistentManifoldSortPredicate { public: - SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs ) + SIMD_FORCE_INLINE bool operator() ( const btPersistentManifold* lhs, const btPersistentManifold* rhs ) const { return getIslandId(lhs) < getIslandId(rhs); } diff --git a/src/BulletCollision/CollisionDispatch/btUnionFind.cpp b/src/BulletCollision/CollisionDispatch/btUnionFind.cpp index 4c4f58d44..522293359 100644 --- a/src/BulletCollision/CollisionDispatch/btUnionFind.cpp +++ b/src/BulletCollision/CollisionDispatch/btUnionFind.cpp @@ -53,7 +53,7 @@ class btUnionFindElementSortPredicate { public: - bool operator() ( const btElement& lhs, const btElement& rhs ) + bool operator() ( const btElement& lhs, const btElement& rhs ) const { return lhs.m_id < rhs.m_id; } diff --git a/src/BulletCollision/Gimpact/btContactProcessing.cpp b/src/BulletCollision/Gimpact/btContactProcessing.cpp index c3b697bdd..eed31d839 100644 --- a/src/BulletCollision/Gimpact/btContactProcessing.cpp +++ b/src/BulletCollision/Gimpact/btContactProcessing.cpp @@ -58,7 +58,7 @@ class CONTACT_KEY_TOKEN_COMP { public: - bool operator() ( const CONTACT_KEY_TOKEN& a, const CONTACT_KEY_TOKEN& b ) + bool operator() ( const CONTACT_KEY_TOKEN& a, const CONTACT_KEY_TOKEN& b ) const { return ( a < b ); } diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 778ba4386..d99d01f44 100644 --- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -71,7 +71,7 @@ class btSortConstraintOnIslandPredicate { public: - bool operator() ( const btTypedConstraint* lhs, const btTypedConstraint* rhs ) + bool operator() ( const btTypedConstraint* lhs, const btTypedConstraint* rhs ) const { int rIslandId0,lIslandId0; rIslandId0 = btGetConstraintIslandId(rhs); diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp index f1f8e576f..5efd3576e 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp @@ -1245,7 +1245,7 @@ void btDX11SoftBodySolver::prepareCollisionConstraints() { public: - bool operator() ( const CollisionShapeDescription& a, const CollisionShapeDescription& b ) + bool operator() ( const CollisionShapeDescription& a, const CollisionShapeDescription& b ) const { return ( a.softBodyIdentifier < b.softBodyIdentifier ); } diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp index b45cc6bce..a4f0d2ef3 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.cpp @@ -1175,7 +1175,7 @@ class QuickSortCompare { public: - bool operator() ( const CollisionShapeDescription& a, const CollisionShapeDescription& b ) + bool operator() ( const CollisionShapeDescription& a, const CollisionShapeDescription& b ) const { return ( a.softBodyIdentifier < b.softBodyIdentifier ); } diff --git a/src/LinearMath/btAlignedObjectArray.h b/src/LinearMath/btAlignedObjectArray.h index fab6e7e63..ab032c13b 100644 --- a/src/LinearMath/btAlignedObjectArray.h +++ b/src/LinearMath/btAlignedObjectArray.h @@ -314,7 +314,7 @@ protected: }; template - void quickSortInternal(L CompareFunc,int lo, int hi) + void quickSortInternal(const L& CompareFunc,int lo, int hi) { // lo is the lower index, hi is the upper index // of the region of array a that is to be sorted @@ -344,7 +344,7 @@ protected: template - void quickSort(L CompareFunc) + void quickSort(const L& CompareFunc) { //don't sort 0 or 1 elements if (size()>1) @@ -356,7 +356,7 @@ protected: ///heap sort from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Heap/ template - void downHeap(T *pArr, int k, int n,L CompareFunc) + void downHeap(T *pArr, int k, int n, const L& CompareFunc) { /* PRE: a[k+1..N] is a heap */ /* POST: a[k..N] is a heap */ @@ -402,7 +402,7 @@ protected: } template - void heapSort(L CompareFunc) + void heapSort(const L& CompareFunc) { /* sort a[0..N-1], N.B. 0 to N-1 */ int k; diff --git a/src/LinearMath/btGrahamScan2dConvexHull.h b/src/LinearMath/btGrahamScan2dConvexHull.h index 04ef82898..aa933c177 100644 --- a/src/LinearMath/btGrahamScan2dConvexHull.h +++ b/src/LinearMath/btGrahamScan2dConvexHull.h @@ -39,7 +39,7 @@ struct btAngleCompareFunc { : m_anchor(anchor) { } - bool operator()(const GrahamVector2& a, const GrahamVector2& b) { + bool operator()(const GrahamVector2& a, const GrahamVector2& b) const { if (a.m_angle != b.m_angle) return a.m_angle < b.m_angle; else