QDebug: finish porting to qsizetype/size_t

Port two variables from int/uint to qsizetype/size_t. These don't
cause problems, because their possible ranges are limited, however,
int/uint variables are a code smell these days, so replace them
nonetheless.

[ChangeLog][QtCore][QDebug] Fixed issues on 64-bit platforms when
streaming containers (incl. strings) of more than 2Gi elements.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103525
Change-Id: Ica6c5a6a062990306280fb713c47adb2053b752d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2022-08-17 18:15:46 +02:00
parent db44800627
commit d8561b1dea
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, si
}
// print as an escape sequence (maybe, see below for surrogate pairs)
int buflen = 2;
qsizetype buflen = 2;
ushort buf[sizeof "\\U12345678" - 1];
buf[0] = '\\';

View File

@ -383,7 +383,7 @@ void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, Int value)
debug.resetFormat();
debug.nospace() << "QFlags(" << Qt::hex << Qt::showbase;
bool needSeparator = false;
for (uint i = 0; i < sizeofT * 8; ++i) {
for (size_t i = 0; i < sizeofT * 8; ++i) {
if (value & (Int(1) << i)) {
if (needSeparator)
debug << '|';