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>bb10
parent
c1991c63fc
commit
538378f229
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue