Skip to content

Commit 93d0502

Browse files
committed
changed using <cmath> on <math.h>
1 parent e6c5a51 commit 93d0502

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/webdriver/extension_qt/graphics_web_view_executor.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
#include <QtGui/QApplication>
2222
#endif
2323

24-
#include <cmath>
24+
#define _USE_MATH_DEFINES
25+
#include <math.h>
2526

2627
namespace webdriver {
2728

@@ -445,8 +446,8 @@ void GraphicsWebViewCmdExecutor::ClickElement(const ElementId& element, Error**
445446
*error = webkitProxy_->GetClickableLocation(element, &location);
446447
if (!(*error)) {
447448
// consider truncation, round up value
448-
location.setX(std::ceil(location.x()));
449-
location.setY(std::ceil(location.y()));
449+
location.setX(ceil(location.x()));
450+
location.setY(ceil(location.y()));
450451

451452
session_->logger().Log(kFineLogLevel,
452453
base::StringPrintf("ClickElement at pos (%f, %f).", location.x(), location.y()));

src/webdriver/extension_qt/qml_web_view_executor.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include <QtGui/QStyleOptionGraphicsItem>
1717
#include <QtGui/QApplication>
1818

19-
#include <cmath>
19+
#define _USE_MATH_DEFINES
20+
#include <math.h>
2021

2122
namespace webdriver {
2223

@@ -411,8 +412,8 @@ void QmlWebViewCmdExecutor::ClickElement(const ElementId& element, Error** error
411412
*error = webkitProxy_->GetClickableLocation(element, &location);
412413
if (!(*error)) {
413414
// consider truncation, round up value
414-
location.setX(std::ceil(location.x()));
415-
location.setY(std::ceil(location.y()));
415+
location.setX(ceil(location.x()));
416+
location.setY(ceil(location.y()));
416417

417418
session_->logger().Log(kFineLogLevel,
418419
base::StringPrintf("ClickElement at pos (%f, %f).", location.x(), location.y()));

src/webdriver/extension_qt/web_view_executor.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#endif
3333

3434
#define _USE_MATH_DEFINES
35-
#include <cmath>
35+
#include <math.h>
3636

3737
class QNetworkCookie;
3838
namespace webdriver {
@@ -397,8 +397,8 @@ void QWebViewCmdExecutor::ClickElement(const ElementId& element, Error** error)
397397
*error = webkitProxy_->GetClickableLocation(element, &location);
398398
if (!(*error)) {
399399
// consider truncation, round up value
400-
location.setX(std::ceil(location.x()));
401-
location.setY(std::ceil(location.y()));
400+
location.setX(ceil(location.x()));
401+
location.setY(ceil(location.y()));
402402

403403
session_->logger().Log(kFineLogLevel,
404404
base::StringPrintf("ClickElement at pos (%f, %f).", location.x(), location.y()));

0 commit comments

Comments
 (0)