diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-06-18 20:11:18 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-09 07:09:44 +0200 |
commit | 60ca2f5f7c38178cfe62d3dbe1b8dacfe43cbac9 (patch) | |
tree | e910b6b5e8f5c28885053d329d2b996989ee2fd9 /src/corelib/io/qurlidna.cpp | |
parent | 36f6bd7cf007c27772de5725791b7bc9040a041d (diff) |
Be less laissez-faire with implicit conversions to QChar
QChar currently is convertible from nearly every integral type. This
is bad code hygiene and should be fixed come Qt 6.
The present patch is the result of compile fixes from marking these
constructors explicit. As is clear from the distribution of fixes,
only low-level string handling code used these implicit conversions,
an indication that they're not in widespread use elsewhere.
Change-Id: Ief5336f21e6d181e03ab92893b3d13a14adc7cb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io/qurlidna.cpp')
-rw-r--r-- | src/corelib/io/qurlidna.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 2f89d22660..a2f0caa606 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2220,9 +2220,8 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(const QChar *s, int ucLength, QString bool skipped = false; // copy all basic code points verbatim to output. for (uint j = 0; j < (uint) ucLength; ++j) { - ushort js = s[j].unicode(); - if (js < 0x80) - *d++ = js; + if (s[j].unicode() < 0x80) + *d++ = s[j]; else skipped = true; } |