Gui & Mod/Sketcher: use fabs() instead abs()

Warnings was like:
src/Mod/Sketcher/Gui/DrawSketchHandler.cpp|350 col 28| warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
Also see:
http://forum.freecadweb.org/viewtopic.php?t=10920
http://forum.freecadweb.org/viewtopic.php?f=10&t=5258
This commit is contained in:
Alexander Golubev 2015-05-18 11:50:27 +03:00 committed by wmayer
parent 774dac17ac
commit 80941aa0e0
2 changed files with 4 additions and 4 deletions

View File

@ -795,7 +795,7 @@ void NavigationStyle::doZoom(SoCamera* camera, float logfactor, const SbVec2f& p
{
// something is asking for big zoom factor. This func is made for interactive zooming,
// where the changes are per mouse move and thus are small.
if (abs(logfactor)>4.0)
if (fabs(logfactor)>4.0)
return;
SbBool zoomAtCur = this->zoomAtCursor;
if (zoomAtCur) {

View File

@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2010 *
* Copyright (c) J<EFBFBD>rgen Riegel (juergen.riegel@web.de) 2010 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@ -1354,7 +1354,7 @@ int Sketch::addAngleAtPointConstraint(
if (angleErr < -M_PI) angleErr += M_PI*2;
//the autodetector
if(abs(angleErr) > M_PI/2 )
if(fabs(angleErr) > M_PI/2 )
angleDesire += M_PI;
*angle = angleDesire;
@ -1757,7 +1757,7 @@ int Sketch::addSnellsLawConstraint(int geoIdRay1, PointPos posRay1,
double n2divn1=*value;
if ( abs(n2divn1) >= 1.0 ){
if ( fabs(n2divn1) >= 1.0 ){
*n2 = n2divn1;
*n1 = 1.0;
} else {