diff options
author | Neil <nyamatongwe@gmail.com> | 2025-04-03 10:07:20 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-04-03 10:07:20 +1100 |
commit | edb7369a2c6a19393dc413a9595a234969fc2731 (patch) | |
tree | 1dd7de2ad759c58d48606bd8a204503944feec12 /src/Document.cxx | |
parent | f40a7ce87a20e830a4959e33238d2caadef0ea04 (diff) | |
download | scintilla-mirror-edb7369a2c6a19393dc413a9595a234969fc2731.tar.gz |
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.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 5dd64eed9..ddcf43276 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1109,6 +1109,12 @@ bool SCI_METHOD Document::IsDBCSLeadByte(char ch) const { return IsDBCSLeadByteNoExcept(ch); } +// 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 Document::IsDBCSLeadByteNoExcept(char ch) const noexcept { // Used inside core Scintilla // Byte ranges found in Wikipedia articles with relevant search strings in each case @@ -1192,6 +1198,8 @@ unsigned char Document::DBCSMinTrailByte() const noexcept { } } +// NOLINTEND(*-magic-numbers) + int Document::DBCSDrawBytes(std::string_view text) const noexcept { if (text.length() <= 1) { return static_cast<int>(text.length()); |