diff options
author | Jøger Hansegård <joger.hansegard@qt.io> | 2023-05-04 16:31:19 +0200 |
---|---|---|
committer | Jøger Hansegård <joger.hansegard@qt.io> | 2023-05-07 19:05:46 +0200 |
commit | bd6284d42da21bb3480cdbe0535495d4e4275e73 (patch) | |
tree | 68c7b8972d91f0b44cff50e92df2977317d3d661 /src | |
parent | ef6e9f6b75848dfdacdd98cf9e7530f651b3dfca (diff) | |
download | qtdeclarative-bd6284d42da21bb3480cdbe0535495d4e4275e73.tar.gz |
Silence signed vs unsigned warning on 32 bit VS 2022 debug build
The warning C4018: '<': signed/unsigned mismatch appears in a Q_ASSERT
when checking a lookup index against the size of the container.
Fixed by changing from unsigned to signed type for the index. Since the
index is already implicitly converted to signed type when used, we can
use a signed type from the start. We rely on implicit conversion from
unsigned instead of static_cast to not hide other warnings in the
future.
Change-Id: I2b1983bdd40104e2c7135eec849a198ac074517c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/common/qv4compileddata_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h index fbd1b564c0..db2b027bf0 100644 --- a/src/qml/common/qv4compileddata_p.h +++ b/src/qml/common/qv4compileddata_p.h @@ -1537,7 +1537,7 @@ public: if (index < data->stringTableSize) return data->stringAtInternal(index); - const uint dynamicIndex = index - data->stringTableSize; + const qsizetype dynamicIndex = index - data->stringTableSize; Q_ASSERT(dynamicIndex < dynamicStrings.size()); return dynamicStrings.at(dynamicIndex); } |