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/tools/qlocale_p.h | |
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/tools/qlocale_p.h')
-rw-r--r-- | src/corelib/tools/qlocale_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index 1e3da35a02..37afb8542b 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -285,9 +285,9 @@ public: quint16 m_language_id, m_script_id, m_country_id; // FIXME QTBUG-69324: not all unicode code-points map to single-token UTF-16 :-( - quint16 m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential; - quint16 m_quotation_start, m_quotation_end; - quint16 m_alternate_quotation_start, m_alternate_quotation_end; + char16_t m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential; + char16_t m_quotation_start, m_quotation_end; + char16_t m_alternate_quotation_start, m_alternate_quotation_end; quint16 m_list_pattern_part_start_idx, m_list_pattern_part_start_size; quint16 m_list_pattern_part_mid_idx, m_list_pattern_part_mid_size; @@ -417,7 +417,7 @@ inline char QLocaleData::digitToCLocale(QChar in) const if (in == m_group) return ','; - if (in == m_exponential || in == QChar::toUpper(m_exponential)) + if (in == m_exponential || in == QChar(QChar::toUpper(m_exponential))) return 'e'; // In several languages group() is a non-breaking space (U+00A0) or its thin |