From 2cfe99dc4716bb77d500e2e9b88a57ee621e2135 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 25 Mar 2019 11:42:40 +1100 Subject: Use generic std::abs instead of abs and fabs. --- cocoa/InfoBar.mm | 2 +- cocoa/PlatCocoa.mm | 2 +- cocoa/ScintillaView.mm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cocoa') diff --git a/cocoa/InfoBar.mm b/cocoa/InfoBar.mm index 5dd74f46f..db30dd134 100644 --- a/cocoa/InfoBar.mm +++ b/cocoa/InfoBar.mm @@ -351,7 +351,7 @@ static float BarFontSize = 10.0; // We only work with some preset zoom values. If the given value does not correspond // to one then show no selection. - while (count < numberOfDefaultItems && (fabs(newScaleFactor - DefaultScaleMenuFactors[count]) > 0.07)) + while (count < numberOfDefaultItems && (std::abs(newScaleFactor - DefaultScaleMenuFactors[count]) > 0.07)) count++; if (count == numberOfDefaultItems) [mZoomPopup selectItemAtIndex: -1]; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 08b3facfd..2b41f476d 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -252,7 +252,7 @@ void AddToIntervalVector(std::vector &vi, XYPOSITION left, XYPOSITION vi.push_back(interval); } else { Interval &last = vi.back(); - if (fabs(last.right-interval.left) < 0.01) { + if (std::abs(last.right-interval.left) < 0.01) { // If new left is very close to previous right then extend last item last.right = interval.right; } else { diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 116ea36e9..84dbff16a 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -1235,7 +1235,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 zoomDelta += event.magnification * 10.0; - if (fabs(zoomDelta)>=1.0) { + if (std::abs(zoomDelta)>=1.0) { long zoomFactor = static_cast([self getGeneralProperty: SCI_GETZOOM] + zoomDelta); [self setGeneralProperty: SCI_SETZOOM parameter: zoomFactor value: 0]; zoomDelta = 0.0; -- cgit v1.2.3