diff options
author | Hou Lei <houlei@uniontech.com> | 2021-02-08 11:48:23 +0800 |
---|---|---|
committer | Hou Lei <houlei@uniontech.com> | 2021-02-09 10:27:14 +0800 |
commit | 841e63cb77094a7a50fe7c9f0e210b045f7c7402 (patch) | |
tree | 4bf332911c11f45d6919b5e2edd61d9348df8557 /src/gui | |
parent | ff510b98d99a45880cf89b9949175ceda5f084c5 (diff) |
Canonical pointer usage
Other affected rows have also been fixed.
Change-Id: Ie0a32f724bd2e40e7bfacfaa43a78190b58e4a21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qregion.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index df1f2575fe..1e0ce30528 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -300,7 +300,7 @@ void QRegion::exec(const QByteArray &buffer, int ver, QDataStream::ByteOrder byt quint32 n; s >> n; QRect r; - for (int i=0; i<(int)n; i++) { + for (int i=0; i < static_cast<int>(n); i++) { s >> r; rgn = rgn.united(QRegion(r)); } @@ -349,19 +349,19 @@ QDataStream &operator<<(QDataStream &s, const QRegion &r) { auto b = r.begin(), e = r.end(); if (b == e) { - s << (quint32)0; + s << static_cast<quint32>(0); } else { const auto size = e - b; if (s.version() == 1) { for (auto i = size - 1; i > 0; --i) { - s << (quint32)(12 + i * 24); - s << (int)QRGN_OR; + s << static_cast<quint32>(12 + i * 24); + s << static_cast<int>(QRGN_OR); } for (auto it = b; it != e; ++it) - s << (quint32)(4+8) << (int)QRGN_SETRECT << *it; + s << static_cast<quint32>(4+8) << static_cast<int>(QRGN_SETRECT) << *it; } else { s << quint32(4 + 4 + 16 * size); // 16: storage size of QRect - s << (qint32)QRGN_RECTS; + s << static_cast<qint32>(QRGN_RECTS); s << quint32(size); for (auto it = b; it != e; ++it) s << *it; |