Post-review feedback after r234614.
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2018 17:21:04 +0000 (17:21 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Aug 2018 17:21:04 +0000 (17:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188322
<rdar://problem/42455270>

Reviewed by Sam Weinig.

Use std::round instead of roundl — there's no reason to go from double to long double precision when rounding.

* TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
(rounded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234657 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm

index 38a0d4e..8c20de1 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Post-review feedback after r234614.
+        https://bugs.webkit.org/show_bug.cgi?id=188322
+        <rdar://problem/42455270>
+
+        Reviewed by Sam Weinig.
+
+        Use std::round instead of roundl — there's no reason to go from double to long double precision when rounding.
+
+        * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
+        (rounded):
+
 2018-08-07  Don Olmstead  <don.olmstead@sony.com>
 
         [MiniBrowser][Win] Allow selection of recent user agents
index c162b87..1eb27d8 100644 (file)
 #import "UIKitSPI.h"
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKitLegacy/WebEvent.h>
+#import <cmath>
 
 @implementation TestWKWebView (KeyboardInputTests)
 
 static CGRect rounded(CGRect rect)
 {
-    return CGRectMake(roundl(rect.origin.x), roundl(rect.origin.y), roundl(rect.size.width), roundl(rect.size.height));
+    return CGRectMake(std::round(rect.origin.x), std::round(rect.origin.y), std::round(rect.size.width), std::round(rect.size.height));
 }
 
 - (void)waitForCaretViewFrameToBecome:(CGRect)frame