summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/text/qstring.cpp4
-rw-r--r--src/corelib/tools/qcontiguouscache.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 745d3d8047..53e3afab3f 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -10203,11 +10203,11 @@ QDataStream &operator<<(QDataStream &out, const QString &str)
} else {
if (!str.isNull() || out.version() < 3) {
if ((out.byteOrder() == QDataStream::BigEndian) == (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
- out.writeBytes(reinterpret_cast<const char *>(str.unicode()), sizeof(QChar) * str.length());
+ out.writeBytes(reinterpret_cast<const char *>(str.unicode()), uint(sizeof(QChar) * str.length()));
} else {
QVarLengthArray<ushort> buffer(str.length());
qbswap<sizeof(ushort)>(str.constData(), str.length(), buffer.data());
- out.writeBytes(reinterpret_cast<const char *>(buffer.data()), sizeof(ushort) * buffer.size());
+ out.writeBytes(reinterpret_cast<const char *>(buffer.data()), uint(sizeof(ushort) * buffer.size()));
}
} else {
// write null marker
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index df76c9fb50..81361f219a 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -137,8 +137,9 @@ public:
void removeLast();
T takeLast();
+ // Use extra parentheses around max to avoid expanding it if it is a macro.
inline bool areIndexesValid() const
- { return d->offset >= 0 && d->offset < std::numeric_limits<qsizetype>::max() - d->count && (d->offset % d->alloc) == d->start; }
+ { return d->offset >= 0 && d->offset < (std::numeric_limits<qsizetype>::max)() - d->count && (d->offset % d->alloc) == d->start; }
inline void normalizeIndexes() { d->offset = d->start; }