diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-08-17 18:15:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-08-21 08:29:11 +0200 |
commit | d8561b1dea4a4cabebcba38ddf2d5b67afa5826e (patch) | |
tree | 47254414363c3f51addd6f780d3d6e347700718e | |
parent | db4480062796482da766a58f4812faf63d8acab0 (diff) | |
download | qtbase-d8561b1dea4a4cabebcba38ddf2d5b67afa5826e.tar.gz |
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>
-rw-r--r-- | src/corelib/io/qdebug.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qdebug.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 0afbb374fa..f07bb05c5b 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -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] = '\\'; diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 3cd8384e3d..c95c03f0d1 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -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 << '|'; |