From 0341bf2e979264b9f7606bd57e594a41c27a38cc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 22 May 2020 11:26:21 +0200 Subject: Make QArrayDataPointer::size a qsizetype This is a next step towards making QList, QString and QByteArray able to deal with large sizes. Change-Id: Icad49b33f503401ac4912678b2f88584c6f91a63 Reviewed-by: Thiago Macieira --- src/corelib/text/qstring.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/text/qstring.cpp') diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 8e572691c62..c98b1f82b64 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -2364,7 +2364,7 @@ void QString::reallocData(uint alloc, bool grow) allocOptions |= QArrayData::GrowsForward; if (d->needsDetach()) { - DataPointer dd(Data::allocate(alloc, allocOptions), qMin(int(alloc) - 1, d.size)); + DataPointer dd(Data::allocate(alloc, allocOptions), qMin(qsizetype(alloc) - 1, d.size)); ::memcpy(dd.data(), d.data(), dd.size * sizeof(QChar)); dd.data()[dd.size] = 0; d = dd; @@ -2595,7 +2595,7 @@ QString& QString::insert(int i, const QChar *unicode, int size) if (Q_UNLIKELY(i > int(d.size))) resize(i + size, QLatin1Char(' ')); else - resize(d.size + size); + resize(int(d.size) + size); ::memmove(d.data() + i + size, d.data() + i, (d.size - i - size) * sizeof(QChar)); memcpy(d.data() + i, s, size * sizeof(QChar)); -- cgit v1.2.3