From 82ac7cbbe78eacf997cac7348b18c6805b088090 Mon Sep 17 00:00:00 2001 From: SZY <> Date: Thu, 28 Apr 2011 15:02:22 +0000 Subject: [PATCH] OCC22324 Mistakes with parenthesis position in abs calls --- src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx | 7 ++++--- src/Aspect/Aspect_RectangularGrid.cxx | 2 +- src/GeomFill/GeomFill_BoundWithSurf.cxx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index 2774e0f13d..f1b6d0db76 100755 --- a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -127,13 +127,14 @@ static void Hunt(const TColStd_Array1OfReal& Arr, // when co-ordinate component definitly equals a knot only. Standard_Real Tol=Precision::PConfusion()/10; Standard_Integer i=1; - while((i<=Arr.Upper())&&(Abs(Coord-Arr(i))>Tol)){ + while((i <= Arr.Upper()) && (Abs(Coord - Arr(i)) > Tol)){ i++;} - if(Abs(Coord-Arr(i))Tol)) Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface:Hunt"); + if(Abs(Coord - Arr(i)) > Tol) + Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface:Hunt"); } //======================================================================= diff --git a/src/Aspect/Aspect_RectangularGrid.cxx b/src/Aspect/Aspect_RectangularGrid.cxx index 6ee81faf94..8c166c2855 100755 --- a/src/Aspect/Aspect_RectangularGrid.cxx +++ b/src/Aspect/Aspect_RectangularGrid.cxx @@ -163,7 +163,7 @@ void Aspect_RectangularGrid::Init () { Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha, const Standard_Real beta) const { - return Abs( Sin(alpha)*Cos(beta+Standard_PI/2.) - Cos(alpha)*Sin(beta+Standard_PI/2.) != 0) ; + return (Abs( Sin(alpha) * Cos(beta+Standard_PI/2.) - Cos(alpha) * Sin(beta+Standard_PI/2.)) != 0) ; } diff --git a/src/GeomFill/GeomFill_BoundWithSurf.cxx b/src/GeomFill/GeomFill_BoundWithSurf.cxx index 0eabeee03b..5b0e0b38ea 100755 --- a/src/GeomFill/GeomFill_BoundWithSurf.cxx +++ b/src/GeomFill/GeomFill_BoundWithSurf.cxx @@ -121,7 +121,7 @@ void GeomFill_BoundWithSurf::D1Norm(const Standard_Real U, Standard_Real nsuu = N.Dot(Suu), nsuv = N.Dot(Suv), nsvv = N.Dot(Svv); Standard_Real susu = Su.Dot(Su), susv = Su.Dot(Sv), svsv = Sv.Dot(Sv); Standard_Real deno = (susu*svsv) - (susv*susv); - if(Abs(deno < 1.e-16)){ + if(Abs(deno) < 1.e-16) { // on embraye sur un calcul approche, c est mieux que rien!?! gp_Vec temp = Norm(U + 1.e-12); DN = N.Multiplied(-1.);