diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-22 21:13:28 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-24 21:11:22 +0100 |
commit | 6f1821dfa302c028f7899e4485dfaf24a6a02457 (patch) | |
tree | e0fa45ab2c09574b85f5c590a0ba82def81091b4 /tests/benchmarks/gui | |
parent | c00e443dcc5024aa1239ed2f494da13ab572d238 (diff) |
benchmarks: fix some (future) -Wunused-result warnings
Clang 10 warns about unused results of relational operators, which is
where this is coming from.
Fix by adding the usual prefix
[[maybe_unused]] auto r = ~~~;
to silence the warning. Do this elsewhere, too, since [[nodiscard]] is
slowly being rolled out across all our APIs. This is not a complete
sweep, though.
Not picking to 5.15, because this pattern doesn't work there and I
don't want to introduce a new one.
Pick-to: 6.3 6.2
Change-Id: I40dd8ad07496b686979dce533e044cbb486e30f3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/benchmarks/gui')
-rw-r--r-- | tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp index 6c6bfbb83d..68054f1b88 100644 --- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp +++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp @@ -266,7 +266,7 @@ void tst_QTransform::operatorEqual() QFETCH(QTransform, x2); QTransform x = x1; QBENCHMARK { - x == x2; + [[maybe_unused]] auto r = x == x2; } } @@ -278,7 +278,7 @@ void tst_QTransform::operatorNotEqual() QFETCH(QTransform, x2); QTransform x = x1; QBENCHMARK { - x != x2; + [[maybe_unused]] auto r = x != x2; } } @@ -290,7 +290,7 @@ void tst_QTransform::operatorMultiply() QFETCH(QTransform, x2); QTransform x = x1; QBENCHMARK { - x * x2; + [[maybe_unused]] auto r = x * x2; } } @@ -357,7 +357,7 @@ void tst_QTransform::mapQPoint() QFETCH(QTransform, transform); QTransform x = transform; QBENCHMARK { - x.map(QPoint(3, 3)); + [[maybe_unused]] auto r = x.map(QPoint(3, 3)); } } @@ -368,7 +368,7 @@ void tst_QTransform::mapQPointF() QFETCH(QTransform, transform); QTransform x = transform; QBENCHMARK { - x.map(QPointF(3, 3)); + [[maybe_unused]] auto r = x.map(QPointF(3, 3)); } } @@ -379,7 +379,7 @@ void tst_QTransform::mapRect() QFETCH(QTransform, transform); QTransform x = transform; QBENCHMARK { - x.mapRect(QRect(0, 0, 100, 100)); + [[maybe_unused]] auto r = x.mapRect(QRect(0, 0, 100, 100)); } } @@ -390,7 +390,7 @@ void tst_QTransform::mapRectF() QFETCH(QTransform, transform); QTransform x = transform; QBENCHMARK { - x.mapRect(QRectF(0, 0, 100, 100)); + [[maybe_unused]] auto r = x.mapRect(QRectF(0, 0, 100, 100)); } } @@ -402,7 +402,7 @@ void tst_QTransform::mapQPolygon() QTransform x = transform; QPolygon poly = QPolygon(QRect(0, 0, 100, 100)); QBENCHMARK { - x.map(poly); + [[maybe_unused]] auto r = x.map(poly); } } @@ -414,7 +414,7 @@ void tst_QTransform::mapQPolygonF() QTransform x = transform; QPolygonF poly = QPolygonF(QRectF(0, 0, 100, 100)); QBENCHMARK { - x.map(poly); + [[maybe_unused]] auto r = x.map(poly); } } @@ -428,7 +428,7 @@ void tst_QTransform::mapQRegion() for (int i = 0; i < 10; ++i) region += QRect(i * 10, i * 10, 100, 100); QBENCHMARK { - x.map(region); + [[maybe_unused]] auto r = x.map(region); } } @@ -439,7 +439,7 @@ void tst_QTransform::mapToPolygon() QFETCH(QTransform, transform); QTransform x = transform; QBENCHMARK { - x.mapToPolygon(QRect(0, 0, 100, 100)); + [[maybe_unused]] auto r = x.mapToPolygon(QRect(0, 0, 100, 100)); } } @@ -454,7 +454,7 @@ void tst_QTransform::mapQPainterPath() for (int i = 0; i < 10; ++i) path.addEllipse(i * 10, i * 10, 100, 100); QBENCHMARK { - x.map(path); + [[maybe_unused]] auto r = x.map(path); } } @@ -464,7 +464,7 @@ void tst_QTransform::isIdentity() { QFETCH(QTransform, transform); QBENCHMARK { - transform.isIdentity(); + [[maybe_unused]] auto r = transform.isIdentity(); } } @@ -474,7 +474,7 @@ void tst_QTransform::isAffine() { QFETCH(QTransform, transform); QBENCHMARK { - transform.isAffine(); + [[maybe_unused]] auto r = transform.isAffine(); } } @@ -484,7 +484,7 @@ void tst_QTransform::isInvertible() { QFETCH(QTransform, transform); QBENCHMARK { - transform.isInvertible(); + [[maybe_unused]] auto r = transform.isInvertible(); } } @@ -494,7 +494,7 @@ void tst_QTransform::isRotating() { QFETCH(QTransform, transform); QBENCHMARK { - transform.isRotating(); + [[maybe_unused]] auto r = transform.isRotating(); } } @@ -504,7 +504,7 @@ void tst_QTransform::isScaling() { QFETCH(QTransform, transform); QBENCHMARK { - transform.isScaling(); + [[maybe_unused]] auto r = transform.isScaling(); } } @@ -514,7 +514,7 @@ void tst_QTransform::isTranslating() { QFETCH(QTransform, transform); QBENCHMARK { - transform.isTranslating(); + [[maybe_unused]] auto r = transform.isTranslating(); } } @@ -524,7 +524,7 @@ void tst_QTransform::type() { QFETCH(QTransform, transform); QBENCHMARK { - transform.type(); + [[maybe_unused]] auto r = transform.type(); } } @@ -534,7 +534,7 @@ void tst_QTransform::determinant() { QFETCH(QTransform, transform); QBENCHMARK { - transform.determinant(); + [[maybe_unused]] auto r = transform.determinant(); } } |