aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/InfoBar.mm4
-rw-r--r--cocoa/PlatCocoa.mm13
-rw-r--r--cocoa/ScintillaCocoa.mm4
-rw-r--r--cocoa/ScintillaView.mm6
4 files changed, 17 insertions, 10 deletions
diff --git a/cocoa/InfoBar.mm b/cocoa/InfoBar.mm
index c7061e6f7..19f2c6943 100644
--- a/cocoa/InfoBar.mm
+++ b/cocoa/InfoBar.mm
@@ -10,6 +10,8 @@
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
*/
+#include <cmath>
+
#import "InfoBar.h"
//--------------------------------------------------------------------------------------------------
@@ -36,7 +38,7 @@
if (heightDelta > 0)
{
newRect.size.height -= heightDelta;
- newRect.origin.y += ceil(heightDelta / 2);
+ newRect.origin.y += std::ceil(heightDelta / 2);
}
}
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 65481c252..9ba85bc66 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -17,6 +17,7 @@
#include <cassert>
#include <cstring>
#include <cstdio>
+#include <cmath>
#include <stdexcept>
#include <vector>
@@ -455,8 +456,8 @@ void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back)
{
FillColour(back);
// Snap rectangle boundaries to nearest int
- rc.left = lround(rc.left);
- rc.right = lround(rc.right);
+ rc.left = std::round(rc.left);
+ rc.right = std::round(rc.right);
CGRect rect = PRectangleToCGRect(rc);
CGContextFillRect(gc, rect);
}
@@ -646,8 +647,8 @@ void Scintilla::SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, Colou
{
if ( gc ) {
// Snap rectangle boundaries to nearest int
- rc.left = lround(rc.left);
- rc.right = lround(rc.right);
+ rc.left = std::round(rc.left);
+ rc.right = std::round(rc.right);
// Set the Fill color to match
CGContextSetRGBFillColor( gc, fill.GetRed() / 255.0, fill.GetGreen() / 255.0, fill.GetBlue() / 255.0, alphaFill / 255.0 );
CGContextSetRGBStrokeColor( gc, outline.GetRed() / 255.0, outline.GetGreen() / 255.0, outline.GetBlue() / 255.0, alphaOutline / 255.0 );
@@ -1064,7 +1065,7 @@ XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) {
const int sizeStringLength = ELEMENTS( sizeString );
XYPOSITION width = WidthText( font_, sizeString, sizeStringLength );
- return round(width / sizeStringLength);
+ return std::round(width / sizeStringLength);
}
void SurfaceImpl::SetClip(PRectangle rc) {
@@ -1651,7 +1652,7 @@ void ListBoxImpl::SetFont(Font& font_)
font.SetID(new QuartzTextStyle(*style));
NSFont *pfont = (NSFont *)style->getFontRef();
[[colText dataCell] setFont: pfont];
- CGFloat itemHeight = ceil([pfont boundingRectForFont].size.height);
+ CGFloat itemHeight = std::ceil([pfont boundingRectForFont].size.height);
[table setRowHeight:itemHeight];
}
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index d262e79b2..3eaf17665 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -14,6 +14,8 @@
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
*/
+#include <cmath>
+
#include <vector>
#import <Cocoa/Cocoa.h>
@@ -2622,7 +2624,7 @@ void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining
layerFindIndicator = [[FindHighlightLayer alloc] init];
[content setWantsLayer: YES];
layerFindIndicator.geometryFlipped = content.layer.geometryFlipped;
- if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8)
+ if (std::floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8)
{
// Content layer is unflipped on 10.9, but the indicator shows wrong unless flipped
layerFindIndicator.geometryFlipped = YES;
diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm
index 5ff9457d4..d1816a25d 100644
--- a/cocoa/ScintillaView.mm
+++ b/cocoa/ScintillaView.mm
@@ -9,6 +9,8 @@
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
*/
+#include <cmath>
+
#include <vector>
#import "Platform.h"
@@ -811,14 +813,14 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor)
// Only snap for positions inside the document - allow outside
// for overshoot.
long lineHeight = mOwner.backend->WndProc(SCI_TEXTHEIGHT, 0, 0);
- rc.origin.y = roundf(static_cast<XYPOSITION>(rc.origin.y) / lineHeight) * lineHeight;
+ rc.origin.y = std::round(static_cast<XYPOSITION>(rc.origin.y) / lineHeight) * lineHeight;
}
// Snap to whole points - on retina displays this avoids visual debris
// when scrolling horizontally.
if ((rc.origin.x > 0) && (NSMaxX(rc) < contentRect.size.width)) {
// Only snap for positions inside the document - allow outside
// for overshoot.
- rc.origin.x = roundf(static_cast<XYPOSITION>(rc.origin.x));
+ rc.origin.x = std::round(static_cast<XYPOSITION>(rc.origin.x));
}
return rc;
}