From fc5015877f2fbf81178b5eb0aefccab5ace0a35d Mon Sep 17 00:00:00 2001 From: Tatiana Borisova Date: Thu, 29 Aug 2024 12:52:52 +0200 Subject: [PATCH] tst_bench_qtimezone: fix a 'sign-compare' warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The problem is found by a clang-tidy tool. Use size_t instead of qsizetype as a type for the index variable to get rid of the warning. The clang-tidy output: tst_bench_qtimezone.cpp:130:30: warning: comparison of integer expressions of different signedness: ‘qsizetype’ {aka ‘long long int’} and ‘std::size_t’ {aka ‘long unsigned int’} [-Wsign-compare] locIndex < std::size(locName) ? locName[locIndex] : where.bcp47Name().toUtf8(); Task-number: QTBUG-105464 Change-Id: I603cbf201827e6e502c9737b02928f31ad6b2517 Reviewed-by: Ivan Solovev --- tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp index 6c1f51983f1..6f6acbe0f86 100644 --- a/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp +++ b/tests/benchmarks/corelib/time/qtimezone/tst_bench_qtimezone.cpp @@ -123,7 +123,7 @@ void tst_QTimeZone::displayName_data() const auto names = enoughZones(); for (const auto &name : names) { for (const auto &when : times) { - qsizetype locIndex = 0; + std::size_t locIndex = 0; for (const auto &where : locs) { const QByteArray dt = when.toString(Qt::ISODate).toUtf8(); const QByteArray loc =