diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp index 9142533830e..73fe55d07c1 100644 --- a/src/corelib/text/qstringconverter.cpp +++ b/src/corelib/text/qstringconverter.cpp @@ -1991,7 +1991,7 @@ const char *QStringConverter::name() const noexcept */ std::optional QStringConverter::encodingForName(const char *name) noexcept { - for (int i = 0; i < LastEncoding + 1; ++i) { + for (qsizetype i = 0; i < LastEncoding + 1; ++i) { if (nameMatch(encodingInterfaces[i].name, name)) return QStringConverter::Encoding(i); } @@ -2059,7 +2059,7 @@ static QByteArray parseHtmlMetaForEncoding(QByteArrayView data) if (pos != -1) { pos = charsetSearcher.indexIn(header, pos); if (pos != -1) { - pos += int(qstrlen("charset=")); + pos += qstrlen("charset="); if (pos < header.size() && (header.at(pos) == '\"' || header.at(pos) == '\'')) ++pos; diff --git a/src/corelib/text/qstringconverter_base.h b/src/corelib/text/qstringconverter_base.h index 68900da8f0c..bf464cbb6ff 100644 --- a/src/corelib/text/qstringconverter_base.h +++ b/src/corelib/text/qstringconverter_base.h @@ -129,7 +129,7 @@ protected: : iface(nullptr) {} constexpr explicit QStringConverter(Encoding encoding, Flags f) - : iface(&encodingInterfaces[int(encoding)]), state(f) + : iface(&encodingInterfaces[qsizetype(encoding)]), state(f) {} constexpr explicit QStringConverter(const Interface *i) noexcept : iface(i)