Peer pressure :) Fix some very public (but probably harmless) errors in extern/bullet...
authorErwin Coumans <blender@erwincoumans.com>
Tue, 24 Apr 2012 05:28:19 +0000 (05:28 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Tue, 24 Apr 2012 05:28:19 +0000 (05:28 +0000)
https://www.assembla.com/code/bullet3/subversion/nodes
Thanks to Campbell for letting me know
Fixed described by Sean here:
http://stackoverflow.com/questions/818535/how-can-i-set-all-bits-to-1-in-a-binary-number-of-an-unknown-size

extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h

index aa30d43a025381295446ca6d8e59b0bd3fa38ade..51b27afe6866612359e52c844eb036540ca26697 100644 (file)
@@ -78,8 +78,10 @@ ATTRIBUTE_ALIGNED16  (struct) btQuantizedBvhNode
        int     getTriangleIndex() const
        {
                btAssert(isLeafNode());
+               unsigned int x=0;
+               unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS);
                // Get only the lower bits where the triangle index is stored
-               return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
+               return (m_escapeIndexOrTriangleIndex&~(y));
        }
        int     getPartId() const
        {
index a6ea33717bc9288968e52909dfb492f0be904b67..f311419d4a82496e38ed466acaab420b1c8c73d6 100644 (file)
@@ -45,7 +45,9 @@ struct btTriIndex
        int     getTriangleIndex() const
        {
                // Get only the lower bits where the triangle index is stored
-               return (m_PartIdTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
+               unsigned int x = 0;
+               unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS);
+               return (m_PartIdTriangleIndex&~(y));
        }
        int     getPartId() const
        {