From 631eed68d0ea5e1e8e5c2ad7d56b3dcbfbcb4aa0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Sep 2020 14:03:21 +0200 Subject: Fix some MSVC conversion warnings Change-Id: Ib2c1fdb7b84f89201136438362ab5962126ec929 Reviewed-by: Joerg Bornemann --- src/corelib/io/qprocess_win.cpp | 4 ++-- src/corelib/text/qbytearray.cpp | 2 +- src/corelib/text/qstringconverter.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 148c6378c6..2663316de0 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -452,7 +452,7 @@ static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Map &e copy.insert(rootKey, QString::fromLocal8Bit(systemRoot)); } - int pos = 0; + qsizetype pos = 0; auto it = copy.constBegin(); const auto end = copy.constEnd(); @@ -460,7 +460,7 @@ static QByteArray qt_create_environment(const QProcessEnvironmentPrivate::Map &e static const wchar_t nul = L'\0'; for ( ; it != end; ++it) { - uint tmpSize = sizeof(wchar_t) * (it.key().length() + it.value().length() + 2); + qsizetype tmpSize = sizeof(wchar_t) * (it.key().length() + it.value().length() + 2); // ignore empty strings if (tmpSize == sizeof(wchar_t) * 2) continue; diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 1c40bba377..46902bdec8 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -647,7 +647,7 @@ QByteArray qUncompress(const uchar* data, qsizetype nbytes) return invalidCompressedData(); forever { - ulong alloc = len; + const auto alloc = len; int res = ::uncompress((uchar*)d.data(), reinterpret_cast(&len), data+4, nbytes-4); diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index 4af4a1af9d..755c20d7aa 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -1790,7 +1790,7 @@ std::optional QStringConverter::encodingForHtml(cons if (pos != -1) { pos = header.indexOf("charset=", pos); if (pos != -1) { - pos += qstrlen("charset="); + pos += int(qstrlen("charset=")); if (pos < header.size() && (header.at(pos) == '\"' || header.at(pos) == '\'')) ++pos; -- cgit v1.2.3