From dfe86d0150da443e807d66f4f945fec001929666 Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Mon, 29 Mar 2021 10:16:01 +0200 Subject: Fix some warnings Change-Id: I546300b4e630a2234c83c03ece65a08f4c8652d2 Reviewed-by: Sona Kurazyan --- tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp | 3 +++ .../corelib/tools/containers-sequential/main.cpp | 8 ++++---- .../corelib/tools/qcryptographichash/main.cpp | 18 +++++++++++++++++- tests/benchmarks/corelib/tools/qrect/main.cpp | 8 ++++---- .../gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp | 6 ++++-- .../gui/math3d/qquaternion/tst_qquaternion.cpp | 1 + .../gui/painting/qtransform/tst_qtransform.cpp | 6 +++--- .../graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp | 1 + 8 files changed, 37 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp index 3e7f520b76..0bc0a7de93 100644 --- a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp @@ -115,6 +115,7 @@ void tst_bench_QUuid::fromRfc4122() QByteArray string = QByteArray::fromHex("67C8770B44F1410AAB9AF9B5446F13EE"); QBENCHMARK { QUuid uuid = QUuid::fromRfc4122(string); + Q_UNUSED(uuid) } } @@ -124,6 +125,7 @@ void tst_bench_QUuid::createUuidV3() QByteArray name = QByteArray("Test"); QBENCHMARK { QUuid uuid = QUuid::createUuidV3(ns, name); + Q_UNUSED(uuid) } } @@ -133,6 +135,7 @@ void tst_bench_QUuid::createUuidV5() QByteArray name = QByteArray("Test"); QBENCHMARK { QUuid uuid = QUuid::createUuidV5(ns, name); + Q_UNUSED(uuid) } } diff --git a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp index 98716e83a9..1bb1a02a24 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp +++ b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp @@ -55,7 +55,7 @@ T * f(T *ts) // dummy function to prevent code from being optimized away by the template class UseCases_QList : public UseCases { - void insert(int size) + void insert(int size) override { QList v; T t{}; @@ -65,7 +65,7 @@ class UseCases_QList : public UseCases } } - void lookup(int size) + void lookup(int size) override { QList v; @@ -87,7 +87,7 @@ class UseCases_QList : public UseCases template class UseCases_stdvector : public UseCases { - void insert(int size) + void insert(int size) override { std::vector v; T t; @@ -97,7 +97,7 @@ class UseCases_stdvector : public UseCases } } - void lookup(int size) + void lookup(int size) override { std::vector v; diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp index 792132cc47..1f0a7373bb 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/main.cpp @@ -88,9 +88,25 @@ const char *algoname(int i) return "keccak_384-"; case QCryptographicHash::Keccak_512: return "keccak_512-"; + case QCryptographicHash::Blake2b_160: + return "blake2b_160-"; + case QCryptographicHash::Blake2b_256: + return "blake2b_256-"; + case QCryptographicHash::Blake2b_384: + return "blake2b_384-"; + case QCryptographicHash::Blake2b_512: + return "blake2b_512-"; + case QCryptographicHash::Blake2s_128: + return "blake2s_128-"; + case QCryptographicHash::Blake2s_160: + return "blake2s_160-"; + case QCryptographicHash::Blake2s_224: + return "blake2s_224-"; + case QCryptographicHash::Blake2s_256: + return "blake2s_256-"; } Q_UNREACHABLE(); - return 0; + return nullptr; } tst_bench_QCryptographicHash::tst_bench_QCryptographicHash() diff --git a/tests/benchmarks/corelib/tools/qrect/main.cpp b/tests/benchmarks/corelib/tools/qrect/main.cpp index 485e0290f8..7ddf17845c 100644 --- a/tests/benchmarks/corelib/tools/qrect/main.cpp +++ b/tests/benchmarks/corelib/tools/qrect/main.cpp @@ -221,7 +221,7 @@ void tst_qrect::intersected() QRect r1(rf1.toRect()); QRect r2(rf2.toRect()); QBENCHMARK { - r1.intersected(r2); + Q_UNUSED(r1.intersected(r2)) } } @@ -237,7 +237,7 @@ void tst_qrect::united() QRect r1(rf1.toRect()); QRect r2(rf2.toRect()); QBENCHMARK { - r1.united(r2); + Q_UNUSED(r1.united(r2)) } } @@ -293,7 +293,7 @@ void tst_qrect::intersected_f() QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); QBENCHMARK { - rf1.intersected(rf2); + Q_UNUSED(rf1.intersected(rf2)) } } @@ -307,7 +307,7 @@ void tst_qrect::united_f() QFETCH(QRectF, rf1); QFETCH(QRectF, rf2); QBENCHMARK { - rf1.united(rf2); + Q_UNUSED(rf1.united(rf2)) } } diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp index db9f2bbfb7..528256d7df 100644 --- a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp +++ b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp @@ -210,7 +210,8 @@ void tst_QMatrix4x4::mapVector3D() m1.optimize(); QBENCHMARK { - result = m1 * v; + result = m1.map(v); + Q_UNUSED(result) } // Force the result to be stored so the compiler doesn't @@ -234,7 +235,8 @@ void tst_QMatrix4x4::mapVector2D() m1.optimize(); QBENCHMARK { - result = m1 * v; + result = m1.map(v); + Q_UNUSED(result) } // Force the result to be stored so the compiler doesn't diff --git a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp index 05c09712cd..6a97f417a8 100644 --- a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp +++ b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp @@ -102,6 +102,7 @@ void tst_QQuaternion::multiply() QBENCHMARK { QQuaternion q3 = q1 * q2; + Q_UNUSED(q3) } } diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp index d28f9502d7..65748997bb 100644 --- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp +++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp @@ -544,7 +544,7 @@ void tst_QTransform::adjoint() { QFETCH(QTransform, transform); QBENCHMARK { - transform.adjoint(); + Q_UNUSED(transform.adjoint()) } } @@ -554,7 +554,7 @@ void tst_QTransform::transposed() { QFETCH(QTransform, transform); QBENCHMARK { - transform.transposed(); + Q_UNUSED(transform.transposed()) } } @@ -564,7 +564,7 @@ void tst_QTransform::inverted() { QFETCH(QTransform, transform); QBENCHMARK { - transform.inverted(); + Q_UNUSED(transform.inverted()) } } diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp index 6145fabbf8..5f36759c9b 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp @@ -217,6 +217,7 @@ void tst_QGraphicsScene::itemAt() QGraphicsItem *item = 0; QBENCHMARK { item = scene.items(QPointF(0, 0)).value(0, nullptr); + Q_UNUSED(item) } //let QGraphicsScene::_q_polishItems be called so ~QGraphicsItem doesn't spend all his time cleaning the unpolished list -- cgit v1.2.3