diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-07 14:45:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-10 03:16:34 +0200 |
commit | bbec7aaf3a8cf81f28810db2270c787cc9910268 (patch) | |
tree | 1a9fc258a1f7bddd3d9ff271eb9a928694363656 /src/corelib/text | |
parent | d49a7412f55390e461773f4ffc36a82958d59b6d (diff) |
Fix a number of MSVC integer conversion warnings
Mostly related to qstrlen().
Change-Id: I69e2052c83766e4fc466ed398d0d0eac011a77ec
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qbytearray.cpp | 2 | ||||
-rw-r--r-- | src/corelib/text/qlocale.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 1eb5162fb1..521b970137 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -636,7 +636,7 @@ QByteArray qUncompress(const uchar* data, qsizetype nbytes) size_t expectedSize = size_t((data[0] << 24) | (data[1] << 16) | (data[2] << 8) | (data[3] )); size_t len = qMax(expectedSize, 1ul); - const ulong maxPossibleSize = MaxAllocSize - sizeof(QByteArray::Data); + const size_t maxPossibleSize = MaxAllocSize - sizeof(QByteArray::Data); if (Q_UNLIKELY(len >= maxPossibleSize)) { // QByteArray does not support that huge size anyway. return invalidCompressedData(); diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 152570bc84..c20e117778 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -3992,8 +3992,8 @@ QString QLocale::currencySymbol(QLocale::CurrencySymbolFormat format) const return d->m_data->currencyDisplayName().getListEntry(currency_display_name_data, 0); case CurrencyIsoCode: { const char *code = d->m_data->m_currency_iso_code; - if (int len = qstrnlen(code, 3)) - return QString::fromLatin1(code, len); + if (auto len = qstrnlen(code, 3)) + return QString::fromLatin1(code, int(len)); break; } } |