Kaydet (Commit) 9fb9b057 authored tarafından Julien Nabet's avatar Julien Nabet

cppcheck: avoid possible division by 0

Change-Id: I8ff8e72d0d25168da374d752a18210cf764ed311
üst 32095947
...@@ -371,11 +371,10 @@ void CGM::ImplDoClass4() ...@@ -371,11 +371,10 @@ void CGM::ImplDoClass4()
double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) ); double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) );
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
if ( fG != 0 ) if ( fG != 0 )
{ {
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint ); double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint ); double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint );
double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint ); double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint );
...@@ -445,11 +444,10 @@ void CGM::ImplDoClass4() ...@@ -445,11 +444,10 @@ void CGM::ImplDoClass4()
double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) ); double fG = 2.0 * ( fA * ( aEndingPoint.Y - aIntermediatePoint.Y ) - fB * ( aEndingPoint.X - aIntermediatePoint.X ) );
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
if ( fG != 0 ) if ( fG != 0 )
{ {
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint ); double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint ); double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint );
double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint ); double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment