diff options
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
| -rw-r--r-- | src/corelib/io/qdebug.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 5d6b5e06be6..4065853d658 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -215,14 +215,14 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, si lastWasHexEscape = false; } - if (sizeof(Char) == sizeof(QChar)) { + if constexpr (sizeof(Char) == sizeof(QChar)) { // Surrogate characters are category Cs (Other_Surrogate), so isPrintable = false for them qsizetype runLength = 0; while (p + runLength != end && isPrintable(p[runLength]) && p[runLength] != '\\' && p[runLength] != '"') ++runLength; if (runLength) { - d->write(reinterpret_cast<const QChar *>(p), runLength); + d->write(QStringView{p, runLength}); p += runLength - 1; continue; } @@ -298,7 +298,7 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, si buf[5] = toHexUpper(*p); buflen = 6; } - d->write(reinterpret_cast<QChar *>(buf), buflen); + d->write(QStringView{buf, buflen}); } d->write(quote); |
