Skip to content

Commit

Permalink
Gui & Mod/Sketcher: use fabs() instead abs()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Fat-Zer authored and wwmayer committed Aug 29, 2015
1 parent 774dac1 commit 80941aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Gui/NavigationStyle.cpp
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/Mod/Sketcher/App/Sketch.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2010 *
* Copyright (c) J�rgen Riegel (juergen.riegel@web.de) 2010 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 80941aa

Please sign in to comment.