From edb7369a2c6a19393dc413a9595a234969fc2731 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 3 Apr 2025 10:07:20 +1100 Subject: Silence 'magic' number clang-tidy warning where there is intense use of literal constants for processing character encodings or similar and where declaring constants would make the code more obscure, not less. --- src/DBCS.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/DBCS.cxx') diff --git a/src/DBCS.cxx b/src/DBCS.cxx index 0f22a705a..f53b8e9ed 100644 --- a/src/DBCS.cxx +++ b/src/DBCS.cxx @@ -16,6 +16,12 @@ using namespace Scintilla::Internal; namespace Scintilla::Internal { +// Silence 'magic' number use since the set of DBCS lead and trail bytes differ +// between encodings and would require many constant declarations that would just +// obscure the behaviour. + +// NOLINTBEGIN(*-magic-numbers) + bool DBCSIsLeadByte(int codePage, char ch) noexcept { // Byte ranges found in Wikipedia articles with relevant search strings in each case const unsigned char uch = ch; @@ -91,6 +97,8 @@ bool IsDBCSValidSingleByte(int codePage, int ch) noexcept { } } +// NOLINTEND(*-magic-numbers) + using CodePageToFoldMap = std::map; CodePageToFoldMap cpToFoldMap; -- cgit v1.2.3