From 65e4aa05ff531aa30e0844560352a4e7494f5b2d Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 25 Jun 2021 12:59:15 -0600 Subject: [PATCH] utf8.h: Refactor UTF8_IS_NONCHAR... UTF8_IS_NONCHAR_GIVEN_THAT_NON_SUPER_AND_GE_PROBLEMATIC() is defined just for backward compatability (though I don't think anyone uses it). Swap which macro is the base level that the other is defined in terms of --- utf8.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utf8.h b/utf8.h index bca33e86a1d2..16b2d13f3ede 100644 --- a/utf8.h +++ b/utf8.h @@ -979,11 +979,6 @@ non-character code points || ( UNLIKELY(UNICODE_IS_END_PLANE_NONCHAR_GIVEN_NOT_SUPER(uv)) \ && LIKELY(! UNICODE_IS_SUPER(uv)))) -/* These are now machine generated, and the 'given' clause is no longer - * applicable */ -#define UTF8_IS_NONCHAR_GIVEN_THAT_NON_SUPER_AND_GE_PROBLEMATIC(s, e) \ - cBOOL(is_NONCHAR_utf8_safe(s,e)) - /* =for apidoc Am|bool|UTF8_IS_NONCHAR|const U8 *s|const U8 *e @@ -995,8 +990,12 @@ point's representation. =cut */ -#define UTF8_IS_NONCHAR(s, e) \ - UTF8_IS_NONCHAR_GIVEN_THAT_NON_SUPER_AND_GE_PROBLEMATIC(s, e) +#define UTF8_IS_NONCHAR(s, e) is_NONCHAR_utf8_safe(s,e) + +/* This is now machine generated, and the 'given' clause is no longer + * applicable */ +#define UTF8_IS_NONCHAR_GIVEN_THAT_NON_SUPER_AND_GE_PROBLEMATIC(s, e) \ + UTF8_IS_NONCHAR(s, e) /* Surrogates, non-character code points and above-Unicode code points are * problematic in some contexts. These macros allow code that needs to check