From 20cdf807b1b6db2189024736047350cdc7be4887 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 22 Apr 2020 12:50:55 +0200 Subject: QChar: port low-level functions from uint/ushort to char32/16_t Now that the standard gives us proper types for UTF-16 and UTF-32 characters, use them. Will eventually make the code much easier to read than today, where uint could be an index as well as a char32_t. It also ensures that the result of e.g. QChar::highSurrogate() can still be implicitly converted to a QChar now that the QChar(non-characater-integral-types) ctors are being made explicit. [ChangeLog][QtCore][QChar] All low-level functions (e.g. highSurrogate()) now take and return char16_t instead of ushort and char32_t instead of uint. Change-Id: I9cd8ebf6fb998fe1075dae96c7c4484a057f0b91 Reviewed-by: Lars Knoll Reviewed-by: Konstantin Ritt --- util/unicode/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util') diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index cde9f40a48..6434d784fe 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -2533,11 +2533,21 @@ static QByteArray createPropertyInfo() " return uc_properties + GET_PROP_INDEX(ucs4);\n" "}\n" "\n" + "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(char32_t ucs4) noexcept\n" + "{\n" + " return qGetProp(uint{ucs4});\n" + "}\n" + "\n" "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) noexcept\n" "{\n" " return uc_properties + GET_PROP_INDEX_UCS2(ucs2);\n" "}\n" "\n" + "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(char16_t ucs2) noexcept\n" + "{\n" + " return qGetProp(ushort{ucs2});\n" + "}\n" + "\n" "Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept\n" "{\n" " return qGetProp(ucs4);\n" -- cgit v1.2.3