From 3d4fafdd662a2ac7267afdaef44bad54302ebe50 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 13 Mar 2020 09:03:15 +1100 Subject: Backport: Using constexpr in UniConversion and CaseConvert. Backport of changeset 8004:7052c60ce1b2. --- src/UniConversion.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/UniConversion.h') diff --git a/src/UniConversion.h b/src/UniConversion.h index e8e98df5f..979075f5a 100644 --- a/src/UniConversion.h +++ b/src/UniConversion.h @@ -10,9 +10,9 @@ namespace Scintilla { -const int UTF8MaxBytes = 4; +constexpr int UTF8MaxBytes = 4; -const int unicodeReplacementChar = 0xFFFD; +constexpr int unicodeReplacementChar = 0xFFFD; size_t UTF8Length(const wchar_t *uptr, size_t tlen) noexcept; void UTF8FromUTF16(const wchar_t *uptr, size_t tlen, char *putf, size_t len); @@ -60,13 +60,13 @@ int UTF8DrawBytes(const unsigned char *us, int len) noexcept; // Line separator is U+2028 \xe2\x80\xa8 // Paragraph separator is U+2029 \xe2\x80\xa9 -const int UTF8SeparatorLength = 3; +constexpr int UTF8SeparatorLength = 3; inline bool UTF8IsSeparator(const unsigned char *us) noexcept { return (us[0] == 0xe2) && (us[1] == 0x80) && ((us[2] == 0xa8) || (us[2] == 0xa9)); } // NEL is U+0085 \xc2\x85 -const int UTF8NELLength = 2; +constexpr int UTF8NELLength = 2; inline bool UTF8IsNEL(const unsigned char *us) noexcept { return (us[0] == 0xc2) && (us[1] == 0x85); } -- cgit v1.2.3