Skip to content

Commit

Permalink
tst_bench_qtimezone: fix a 'sign-compare' warning
Browse files Browse the repository at this point in the history
- 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 <ivan.solovev@qt.io>
  • Loading branch information
qt-tatiana authored and Ivan Solovev committed Sep 16, 2024
1 parent bbf980e commit fc50158
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit fc50158

Please sign in to comment.