Skip to content

Commit

Permalink
utf8.h: Refactor UTF8_IS_NONCHAR...
Browse files Browse the repository at this point in the history
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
  • Loading branch information
khwilliamson committed Aug 7, 2021
1 parent 7ce5b05 commit 65e4aa0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions utf8.h
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 65e4aa0

Please sign in to comment.