diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index ca16fc85816..1ecda4e3325 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -9622,11 +9622,13 @@ 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(str.unicode()), size_t(sizeof(QChar) * str.length())); + out.writeBytes(reinterpret_cast(str.unicode()), + static_cast(sizeof(QChar) * str.length())); } else { QVarLengthArray buffer(str.length()); qbswap(str.constData(), str.length(), buffer.data()); - out.writeBytes(reinterpret_cast(buffer.data()), size_t(sizeof(char16_t) * buffer.size())); + out.writeBytes(reinterpret_cast(buffer.data()), + static_cast(sizeof(char16_t) * buffer.size())); } } else { // write null marker