aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UniConversion.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/UniConversion.cxx')
-rw-r--r--src/UniConversion.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx
index 4cf51c2b9..7183018f7 100644
--- a/src/UniConversion.cxx
+++ b/src/UniConversion.cxx
@@ -326,6 +326,10 @@ const unsigned char UTF8BytesOfLead[256] = {
4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // F0 - FF
};
+// Silence 'magic' number warning as UTF-8 needs to distinguish byte values and byte value ranges.
+
+// NOLINTBEGIN(*-magic-numbers)
+
// Return both the width of the first character in the string and a status
// saying whether it is valid or invalid.
// Most invalid sequences return a width of 1 so are treated as isolated bytes but
@@ -403,6 +407,8 @@ int UTF8Classify(const unsigned char *us, size_t len) noexcept {
return UTF8MaskInvalid | 1;
}
+// NOLINTEND(*-magic-numbers)
+
int UTF8Classify(const char *s, size_t len) noexcept {
return UTF8Classify(reinterpret_cast<const unsigned char *>(s), len);
}