aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2018-01-05 11:36:04 +0200
committerKari Oikarinen <kari.oikarinen@qt.io>2018-01-08 07:18:45 +0000
commit569491715e2db0c2b8a0f57c5b3199dba0c529dc (patch)
treec17389e8349dd1b8ebbb1b6e18f9fa00cb5a011a
parent10c4676322b3a4a0a326a4916e74cac0678de6dd (diff)
Use math functions from std namespace
<cmath> needs to declare the math functions in the std namespace. Optionally it can also put them in the global namespace, but for example the standard library for QNX 6.6 does not do so. Change-Id: Ie4d15d419d7a93c1c04d2b6982dba740d522740a Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
-rw-r--r--src/benchmarkrunner.cpp2
-rw-r--r--src/resultrecorder.cpp2
-rw-r--r--src/testmodel.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/benchmarkrunner.cpp b/src/benchmarkrunner.cpp
index 33dd32a..90c29a8 100644
--- a/src/benchmarkrunner.cpp
+++ b/src/benchmarkrunner.cpp
@@ -131,7 +131,7 @@ qreal stddev(qreal avg, const QList<qreal> &list)
dev += (v - avg) * (v - avg);
// Note: - 1 is intentional!
- return ::sqrt(dev / (list.size() - 1));
+ return std::sqrt(dev / (list.size() - 1));
}
qreal average(const QList<qreal> &list)
diff --git a/src/resultrecorder.cpp b/src/resultrecorder.cpp
index e69794e..343c94a 100644
--- a/src/resultrecorder.cpp
+++ b/src/resultrecorder.cpp
@@ -156,7 +156,7 @@ void ResultRecorder::recordOperationsPerFrameAverage(qreal ops, int samples, qre
benchMap["samples-total"] = samples; // compatibility
benchMap["standard-deviation"] = stddev;
benchMap["standard-deviation-all-samples"] = stddev; // compatibility
- benchMap["standard-error"] = stddev / sqrt(samples);
+ benchMap["standard-error"] = stddev / std::sqrt(samples);
benchMap["coefficient-of-variation"] = stddev / ops;
benchMap["median"] = median;
diff --git a/src/testmodel.cpp b/src/testmodel.cpp
index d53c063..ef28459 100644
--- a/src/testmodel.cpp
+++ b/src/testmodel.cpp
@@ -76,7 +76,7 @@ void TestModel::setRowNumber(int rowNumber)
m_urls.append(QUrl(QString("http://example.org/some-thing-here/%1").arg(i)));
m_jsValues.append(QJSValue(i)); // TODO: should we test object types (like strings?)
m_dateTimes.append(QDateTime(QDate(1995, 5, 20)).addSecs(i));
- m_colors.append(QColor::fromHslF(fmod(0.57 * i, 1.0), 0.5, 0.5));
+ m_colors.append(QColor::fromHslF(std::fmod(0.57 * i, 1.0), 0.5, 0.5));
m_sizes.append(QSize(i, i));
m_points.append(QPoint(i, i));
m_rects.append(QRect(0, 0, i, i));