diff options
author | Karl Williamson <khw@cpan.org> | 2021-07-01 18:47:45 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2021-08-14 06:47:43 -0600 |
commit | 22afef87083fc7ad1b066588f5c20637fd387805 (patch) | |
tree | 74f540e111eb7fbc989150361b1b375861af608a /proto.h | |
parent | 2e5a4e5adeeaafbc8743371293762d71bf27ea15 (diff) | |
download | perl-22afef87083fc7ad1b066588f5c20637fd387805.tar.gz |
is_utf8_valid_partial_char_flags: Use DFA
The DFA macro for determining if a sequence is valid UTF-8 was
deliberately made general enough to accommodate this use-case, in which
only a partial character is acceptable. Change the code to use the DFA.
The helper function's name is changed to indicate it is private
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1780,16 +1780,16 @@ PERL_STATIC_INLINE bool Perl_is_utf8_string_loclen_flags(const U8 *s, STRLEN len #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN_FLAGS \ assert(s) #endif -/* PERL_CALLCONV bool is_utf8_valid_partial_char(const U8 * const s, const U8 * const e) +/* PERL_CALLCONV bool is_utf8_valid_partial_char(const U8 * const s0, const U8 * const e) __attribute__warn_unused_result__ __attribute__pure__; */ #define PERL_ARGS_ASSERT_IS_UTF8_VALID_PARTIAL_CHAR #ifndef PERL_NO_INLINE_FUNCTIONS -PERL_STATIC_INLINE bool Perl_is_utf8_valid_partial_char_flags(const U8 * const s, const U8 * const e, const U32 flags) +PERL_STATIC_INLINE bool Perl_is_utf8_valid_partial_char_flags(const U8 * const s0, const U8 * const e, const U32 flags) __attribute__warn_unused_result__; #define PERL_ARGS_ASSERT_IS_UTF8_VALID_PARTIAL_CHAR_FLAGS \ - assert(s); assert(e) + assert(s0); assert(e) #endif PERL_CALLCONV bool Perl_isinfnan(NV nv) |