[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45908] trunk/blender/extern/bullet2/src: Peer pressure :) Fix some very public (but probably harmless) errors in extern/bullet2, it will propagate to the Bullet soon from here:

Erwin Coumans blender at erwincoumans.com
Tue Apr 24 07:28:19 CEST 2012


Revision: 45908
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45908
Author:   erwin
Date:     2012-04-24 05:28:19 +0000 (Tue, 24 Apr 2012)
Log Message:
-----------
Peer pressure :) Fix some very public (but probably harmless) errors in extern/bullet2, it will propagate to the Bullet soon from here:
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

Modified Paths:
--------------
    trunk/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
    trunk/blender/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h

Modified: trunk/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
===================================================================
--- trunk/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h	2012-04-24 05:02:53 UTC (rev 45907)
+++ trunk/blender/extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h	2012-04-24 05:28:19 UTC (rev 45908)
@@ -78,8 +78,10 @@
 	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
 	{

Modified: trunk/blender/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h
===================================================================
--- trunk/blender/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h	2012-04-24 05:02:53 UTC (rev 45907)
+++ trunk/blender/extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h	2012-04-24 05:28:19 UTC (rev 45908)
@@ -45,7 +45,9 @@
 	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
 	{




More information about the Bf-blender-cvs mailing list