[llvm-commits] [test-suite] r108488 - /test-suite/trunk/MultiSource/Benchmarks/Bullet/btSequentialImpulseConstraintSolver.cpp

Douglas Gregor dgregor at apple.com
Thu Jul 15 17:35:40 PDT 2010


Author: dgregor
Date: Thu Jul 15 19:35:40 2010
New Revision: 108488

URL: http://llvm.org/viewvc/llvm-project?rev=108488&view=rev
Log:
Several uses of the btSimdScalar struct with the negation operator are
relying on an implicit, user-defined conversion to "float". However,
since that struct also has a conversion to a vector type, which GCC
(incorrectly) ignores but Clang (correctly) does not, the use of the
'-' operator is ambiguous.

Explicitly cast the btSimdScalar to "float" before negating it.

Modified:
    test-suite/trunk/MultiSource/Benchmarks/Bullet/btSequentialImpulseConstraintSolver.cpp

Modified: test-suite/trunk/MultiSource/Benchmarks/Bullet/btSequentialImpulseConstraintSolver.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Bullet/btSequentialImpulseConstraintSolver.cpp?rev=108488&r1=108487&r2=108488&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Bullet/btSequentialImpulseConstraintSolver.cpp (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Bullet/btSequentialImpulseConstraintSolver.cpp Thu Jul 15 19:35:40 2010
@@ -567,7 +567,7 @@
 					if (rb0)
 						m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdA].applyImpulse(solverConstraint.m_contactNormal*rb0->getInvMass()*rb0->getLinearFactor(),solverConstraint.m_angularComponentA,solverConstraint.m_appliedImpulse);
 					if (rb1)
-						m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdB].applyImpulse(solverConstraint.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-solverConstraint.m_angularComponentB,-solverConstraint.m_appliedImpulse);
+                                          m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdB].applyImpulse(solverConstraint.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-solverConstraint.m_angularComponentB,-(float)solverConstraint.m_appliedImpulse);
 				} else
 				{
 					solverConstraint.m_appliedImpulse = 0.f;
@@ -668,7 +668,7 @@
 								if (rb0)
 									m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdA].applyImpulse(frictionConstraint1.m_contactNormal*rb0->getInvMass()*rb0->getLinearFactor(),frictionConstraint1.m_angularComponentA,frictionConstraint1.m_appliedImpulse);
 								if (rb1)
-									m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdB].applyImpulse(frictionConstraint1.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-frictionConstraint1.m_angularComponentB,-frictionConstraint1.m_appliedImpulse);
+                                                                  m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdB].applyImpulse(frictionConstraint1.m_contactNormal*rb1->getInvMass()*rb1->getLinearFactor(),-frictionConstraint1.m_angularComponentB,-(float)frictionConstraint1.m_appliedImpulse);
 							} else
 							{
 								frictionConstraint1.m_appliedImpulse = 0.f;
@@ -684,7 +684,7 @@
 								if (rb0)
 									m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdA].applyImpulse(frictionConstraint2.m_contactNormal*rb0->getInvMass(),frictionConstraint2.m_angularComponentA,frictionConstraint2.m_appliedImpulse);
 								if (rb1)
-									m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdB].applyImpulse(frictionConstraint2.m_contactNormal*rb1->getInvMass(),-frictionConstraint2.m_angularComponentB,-frictionConstraint2.m_appliedImpulse);
+                                                                  m_tmpSolverBodyPool[solverConstraint.m_solverBodyIdB].applyImpulse(frictionConstraint2.m_contactNormal*rb1->getInvMass(),-frictionConstraint2.m_angularComponentB,-(float)frictionConstraint2.m_appliedImpulse);
 							} else
 							{
 								frictionConstraint2.m_appliedImpulse = 0.f;





More information about the llvm-commits mailing list