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>
This commit is contained in:
parent
c00e443dcc
commit
6f1821dfa3
@ -188,7 +188,7 @@ void tst_QUrl::equality()
|
||||
QUrl url("pics/avatar.png");
|
||||
QUrl url2("pics/avatar2.png");
|
||||
QBENCHMARK {
|
||||
url == url2;
|
||||
[[maybe_unused]] auto r = url == url2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ private slots:
|
||||
void tst_QUuid::createUuid()
|
||||
{
|
||||
QBENCHMARK {
|
||||
QUuid::createUuid();
|
||||
[[maybe_unused]] auto r = QUuid::createUuid();
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ void tst_QUuid::toString()
|
||||
{
|
||||
QUuid uuid = QUuid::createUuid();
|
||||
QBENCHMARK {
|
||||
uuid.toString();
|
||||
[[maybe_unused]] auto r = uuid.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ void tst_QUuid::toByteArray()
|
||||
{
|
||||
QUuid uuid = QUuid::createUuid();
|
||||
QBENCHMARK {
|
||||
uuid.toByteArray();
|
||||
[[maybe_unused]] auto r = uuid.toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ void tst_QUuid::toRfc4122()
|
||||
{
|
||||
QUuid uuid = QUuid::createUuid();
|
||||
QBENCHMARK {
|
||||
uuid.toRfc4122();
|
||||
[[maybe_unused]] auto r = uuid.toRfc4122();
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ void tst_QUuid::isNull()
|
||||
{
|
||||
QUuid uuid = QUuid();
|
||||
QBENCHMARK {
|
||||
uuid.isNull();
|
||||
[[maybe_unused]] auto r = uuid.isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ void tst_QUuid::operatorLess()
|
||||
uuid1 = QUuid::createUuid();
|
||||
uuid2 = QUuid::createUuid();
|
||||
QBENCHMARK {
|
||||
uuid1 < uuid2;
|
||||
[[maybe_unused]] auto r = uuid1 < uuid2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ void tst_QUuid::operatorMore()
|
||||
uuid1 = QUuid::createUuid();
|
||||
uuid2 = QUuid::createUuid();
|
||||
QBENCHMARK {
|
||||
uuid1 > uuid2;
|
||||
[[maybe_unused]] auto r = uuid1 > uuid2;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user