cppcheck: avoid possible division by 0

Change-Id: I8ff8e72d0d25168da374d752a18210cf764ed311
This commit is contained in:
Julien Nabet 2013-09-27 23:32:53 +02:00
parent 3209594748
commit 9fb9b057d6

View File

@ -371,11 +371,10 @@ void CGM::ImplDoClass4()
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 )
{
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint );
double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint );
@ -445,11 +444,10 @@ void CGM::ImplDoClass4()
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 )
{
aCenterPoint.X = ( fD * fE - fB * fF ) / fG;
aCenterPoint.Y = ( fA * fF - fC * fE ) / fG;
double fStartAngle = ImplGetOrientation( aCenterPoint, aStartingPoint );
double fInterAngle = ImplGetOrientation( aCenterPoint, aIntermediatePoint );
double fEndAngle = ImplGetOrientation( aCenterPoint, aEndingPoint );