summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qsettings_win.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp10
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/serialization/qdatastream.cpp2
-rw-r--r--src/corelib/text/qbytearray.cpp2
-rw-r--r--src/corelib/text/qlocale.cpp4
-rw-r--r--src/network/kernel/qtldurl.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp2
10 files changed, 15 insertions, 15 deletions
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index b2167aa2bc..43593ea25a 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -233,7 +233,7 @@ static QStringList childKeysOrGroups(HKEY parentHandle, QSettingsPrivate::ChildS
QByteArray buff(m * sizeof(wchar_t), 0);
for (int i = 0; i < n; ++i) {
QString item;
- DWORD l = buff.size() / sizeof(wchar_t);
+ DWORD l = DWORD(buff.size()) / DWORD(sizeof(wchar_t));
if (spec == QSettingsPrivate::ChildKeys) {
res = RegEnumValue(parentHandle, i, reinterpret_cast<wchar_t *>(buff.data()), &l, 0, 0, 0, 0);
} else {
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index ef042317c1..be32921273 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -263,7 +263,7 @@ QObject *QMetaObject::newInstance(QGenericArgument val0,
int paramCount;
for (paramCount = 0; paramCount < MaximumParamCount; ++paramCount) {
- int len = qstrlen(typeNames[paramCount]);
+ int len = int(qstrlen(typeNames[paramCount]));
if (len <= 0)
break;
sig.append(typeNames[paramCount], len);
@@ -1184,8 +1184,8 @@ bool QMetaObject::checkConnectArgs(const char *signal, const char *method)
while (*s2++ != '(') { }
if (*s2 == ')' || qstrcmp(s1,s2) == 0) // method has no args or
return true; // exact match
- int s1len = qstrlen(s1);
- int s2len = qstrlen(s2);
+ const auto s1len = qstrlen(s1);
+ const auto s2len = qstrlen(s2);
if (s2len < s1len && strncmp(s1,s2,s2len-1)==0 && s1[s2len-1]==',')
return true; // method has less args
return false;
@@ -1414,7 +1414,7 @@ bool QMetaObject::invokeMethod(QObject *obj,
return false;
QVarLengthArray<char, 512> sig;
- int len = qstrlen(member);
+ int len = int(qstrlen(member));
if (len <= 0)
return false;
sig.append(member, len);
@@ -1426,7 +1426,7 @@ bool QMetaObject::invokeMethod(QObject *obj,
int paramCount;
for (paramCount = 1; paramCount < MaximumParamCount; ++paramCount) {
- len = qstrlen(typeNames[paramCount]);
+ len = int(qstrlen(typeNames[paramCount]));
if (len <= 0)
break;
sig.append(typeNames[paramCount], len);
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 964901fc48..553929955d 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -2342,7 +2342,7 @@ static inline int qMetaTypeTypeImpl(const char *typeName, int length)
*/
Q_CORE_EXPORT int qMetaTypeTypeInternal(const char *typeName)
{
- return qMetaTypeTypeImpl</*tryNormalizedType=*/false>(typeName, qstrlen(typeName));
+ return qMetaTypeTypeImpl</*tryNormalizedType=*/false>(typeName, int(qstrlen(typeName)));
}
/*!
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 5bb225d396..be9d088e7c 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -3574,7 +3574,7 @@ void QMetaObject::connectSlotsByName(QObject *o)
// chosen 'at random' (order of declaration in source file)
QList<QByteArray> compatibleSignals;
const QMetaObject *smo = co->metaObject();
- int sigLen = qstrlen(signal) - 1; // ignore the trailing ')'
+ int sigLen = int(qstrlen(signal)) - 1; // ignore the trailing ')'
for (int k = QMetaObjectPrivate::absoluteSignalCount(smo)-1; k >= 0; --k) {
const QMetaMethod method = QMetaObjectPrivate::signal(smo, k);
if (!qstrncmp(method.methodSignature().constData(), signal, sigLen)) {
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 4712251aa8..e9a8b411a9 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -270,7 +270,7 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
qsizetype pos = 0;
char pattern[] = "qTMETADATA ";
pattern[0] = 'Q'; // Ensure the pattern "QTMETADATA" is not found in this library should QPluginLoader ever encounter it.
- const ulong plen = qstrlen(pattern);
+ const ulong plen = ulong(qstrlen(pattern));
#if defined (Q_OF_ELF) && defined(Q_CC_GNU)
int r = QElfParser().parse(filedata, fdlen, library, lib, &pos, &fdlen);
if (r == QElfParser::Corrupt || r == QElfParser::NotElf) {
diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp
index dddce6075f..c490bfa70d 100644
--- a/src/corelib/serialization/qdatastream.cpp
+++ b/src/corelib/serialization/qdatastream.cpp
@@ -1361,7 +1361,7 @@ QDataStream &QDataStream::operator<<(const char *s)
*this << (quint32)0;
return *this;
}
- uint len = qstrlen(s) + 1; // also write null terminator
+ int len = int(qstrlen(s)) + 1; // also write null terminator
*this << (quint32)len; // write length specifier
writeRawData(s, len);
return *this;
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;
}
}
diff --git a/src/network/kernel/qtldurl.cpp b/src/network/kernel/qtldurl.cpp
index 8601eb711b..7dc4e9cd47 100644
--- a/src/network/kernel/qtldurl.cpp
+++ b/src/network/kernel/qtldurl.cpp
@@ -102,7 +102,7 @@ static bool containsTLDEntry(QStringView entry, TLDMatchType match)
const auto utf8 = tldData[chunk] + chunkIndex;
if ((symbol.isEmpty() || QLatin1Char(*utf8) == symbol) && entry == QString::fromUtf8(utf8 + symbol.size()))
return true;
- chunkIndex += qstrlen(utf8) + 1; // +1 for the ending \0
+ chunkIndex += uint(qstrlen(utf8)) + 1; // +1 for the ending \0
}
return false;
}
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index e5f544c385..0f686dc210 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -678,7 +678,7 @@ QVariant QWindowsMimeText::convertToMime(const QString &mime, LPDATAOBJECT pData
data = getData(CF_TEXT, pDataObj);
if (!data.isEmpty()) {
const char* d = data.data();
- const unsigned s = qstrlen(d);
+ const unsigned s = unsigned(qstrlen(d));
QByteArray r(data.size()+1, '\0');
char* o = r.data();
int j=0;