From 4139a41f3e75cbee698ffad82c5f3f34a32a259c Mon Sep 17 00:00:00 2001 From: Alex <33155126+SpaceAccordeonist@users.noreply.github.com> Date: Wed, 29 Jan 2025 13:52:31 +0300 Subject: [PATCH] Update qstring.cpp Set blockSize type to qsizetype. All variables in evaluation of this value are qsizetype. So it's not a good idea to make it int even if we know that its size is in certain range. Moreover, its size can differ on different platforms. --- src/corelib/text/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index e225852b0f3..06c0b934abd 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -9538,7 +9538,7 @@ QDataStream &operator>>(QDataStream &in, QString &str) qsizetype allocated = 0; while (allocated < len) { - int blockSize = qMin(Step, len - allocated); + qsizetype blockSize = qMin(Step, len - allocated); str.resize(allocated + blockSize); if (in.readRawData(reinterpret_cast(str.data()) + allocated * 2, blockSize * 2) != blockSize * 2) {