summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-07-20 14:06:59 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-07-22 13:05:50 +0200
commit538378f2297cf7299270b09ddca3e4a5e7f8be82 (patch)
treeea0f7a499f02b34184d0ca10e29fad5a2ac0010a
parentc1991c63fc081a42ed3e6a28f82f395c54ef42a1 (diff)
Port QCollator/Posix to qsizetype
Pick-to: 6.4 6.3 6.2 Task-number: QTBUG-105038 Change-Id: If0cbe82105b753dfebfe1fa1ca7cbd759012e3d5 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qcollator_posix.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp
index bddb748535..54c700015b 100644
--- a/src/corelib/text/qcollator_posix.cpp
+++ b/src/corelib/text/qcollator_posix.cpp
@@ -36,7 +36,7 @@ void QCollatorPrivate::cleanup()
static void stringToWCharArray(QVarLengthArray<wchar_t> &ret, QStringView string)
{
ret.resize(string.length());
- int len = string.toWCharArray(ret.data());
+ qsizetype len = string.toWCharArray(ret.data());
ret.resize(len+1);
ret[len] = 0;
}
@@ -70,7 +70,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
std::copy(original.cbegin(), original.cend(), result.begin());
} else {
size_t size = std::wcsxfrm(result.data(), original.constData(), string.size());
- if (size > uint(result.size())) {
+ if (size > size_t(result.size())) {
result.resize(size+1);
size = std::wcsxfrm(result.data(), original.constData(), string.size());
}