Skip to content

Commit 7c4a8f2

Browse files
committed
Placate compiler warnings about abs() in mappers.h (bug #67714)
Clang was issuing over 15000 warnings about having to use std::abs() instead of plain abs() in four specific locations in mappers.h. This changeset does that. There are still some 700 warnings but it's an improvement over 15000. * mappers.h: Change abs() to std::abs() in four functions.
1 parent 59f2b1a commit 7c4a8f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

liboctave/numeric/mappers.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ min (double x, double y, const bool nanflag, const bool realabs)
441441
out = isnan (y) ? x : (x <= y ? x : y);
442442
else
443443
out = isnan (y) ? x :
444-
(abs (x) < abs (y) ? x : (abs (x) == abs (y) && x <= y ? x : y));
444+
(std::abs (x) < std::abs (y) ? x : (std::abs (x) == std::abs (y) && x <= y ? x : y));
445445
return out;
446446
}
447447

@@ -455,7 +455,7 @@ max (double x, double y, const bool nanflag, const bool realabs)
455455
out = isnan (y) ? x : (x >= y ? x : y);
456456
else
457457
out = isnan (y) ? x :
458-
(abs (x) > abs (y) ? x : (abs (x) == abs (y) && x >= y ? x : y));
458+
(std::abs (x) > std::abs (y) ? x : (std::abs (x) == std::abs (y) && x >= y ? x : y));
459459
return out;
460460
}
461461

@@ -503,7 +503,7 @@ min (float x, float y, const bool nanflag, const bool realabs)
503503
out = isnan (y) ? x : (x <= y ? x : y);
504504
else
505505
out = isnan (y) ? x :
506-
(abs (x) < abs (y) ? x : (abs (x) == abs (y) && x <= y ? x : y));
506+
(std::abs (x) < std::abs (y) ? x : (std::abs (x) == std::abs (y) && x <= y ? x : y));
507507
return out;
508508
}
509509

@@ -517,7 +517,7 @@ max (float x, float y, const bool nanflag, const bool realabs)
517517
out = isnan (y) ? x : (x >= y ? x : y);
518518
else
519519
out = isnan (y) ? x :
520-
(abs (x) > abs (y) ? x : (abs (x) == abs (y) && x >= y ? x : y));
520+
(std::abs (x) > std::abs (y) ? x : (std::abs (x) == std::abs (y) && x >= y ? x : y));
521521
return out;
522522
}
523523

0 commit comments

Comments
 (0)