Fix some MSVC conversion warnings

Change-Id: Ib2c1fdb7b84f89201136438362ab5962126ec929
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Friedemann Kleint 2020-09-21 14:03:21 +02:00
parent 1b0e6b909f
commit 631eed68d0
3 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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<uLongf*>(&len),
data+4, nbytes-4);

View File

@ -1790,7 +1790,7 @@ std::optional<QStringConverter::Encoding> 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;