This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Strip leading underscore from is_utf8_char_helper()
authorKarl Williamson <khw@cpan.org>
Tue, 10 Sep 2019 16:59:04 +0000 (10:59 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 15 Sep 2019 16:39:56 +0000 (10:39 -0600)
Leading underscored name are reserved for the C implementers

embed.fnc
embed.h
inline.h
proto.h
utf8.c
utf8.h

index 001279d..8f6b7fe 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -939,7 +939,7 @@ pR  |OP*    |invert         |NULLOK OP* cmd
 ApR    |I32    |is_lvalue_sub
 : Used in cop.h
 XopR   |I32    |was_lvalue_sub
-CpRTP  |STRLEN |_is_utf8_char_helper|NN const U8 * const s|NN const U8 * e|const U32 flags
+CpRTP  |STRLEN |is_utf8_char_helper|NN const U8 * const s|NN const U8 * e|const U32 flags
 CbDpR  |U32    |to_uni_upper_lc|U32 c
 CbDpR  |U32    |to_uni_title_lc|U32 c
 CbDpR  |U32    |to_uni_lower_lc|U32 c
diff --git a/embed.h b/embed.h
index 62dccb2..0218331 100644 (file)
--- a/embed.h
+++ b/embed.h
@@ -33,7 +33,6 @@
 #define _is_uni_perl_idstart(a)        Perl__is_uni_perl_idstart(aTHX_ a)
 #define _is_utf8_FOO(a,b,c,d,e,f,g,h)  Perl__is_utf8_FOO(aTHX_ a,b,c,d,e,f,g,h)
 #define _is_utf8_FOO_with_len(a,b,c)   Perl__is_utf8_FOO_with_len(aTHX_ a,b,c)
-#define _is_utf8_char_helper   Perl__is_utf8_char_helper
 #define _is_utf8_idcont(a)     Perl__is_utf8_idcont(aTHX_ a)
 #define _is_utf8_idstart(a)    Perl__is_utf8_idstart(aTHX_ a)
 #define _is_utf8_mark(a)       Perl__is_utf8_mark(aTHX_ a)
 #ifndef NO_MATHOMS
 #define is_utf8_char           Perl_is_utf8_char
 #endif
+#define is_utf8_char_helper    Perl_is_utf8_char_helper
 #ifndef NO_MATHOMS
 #define is_utf8_cntrl(a)       Perl_is_utf8_cntrl(aTHX_ a)
 #endif
index dfbb985..5f4fc01 100644 (file)
--- a/inline.h
+++ b/inline.h
@@ -1078,7 +1078,7 @@ Perl_isUTF8_CHAR(const U8 * const s0, const U8 * const e)
 #if defined(UV_IS_QUAD) || defined(EBCDIC)
 
     if (NATIVE_UTF8_TO_I8(*s0) == 0xFF && e - s0 >= UTF8_MAXBYTES) {
-       return _is_utf8_char_helper(s0, e, 0);
+       return is_utf8_char_helper(s0, e, 0);
     }
 
 #endif
@@ -1702,7 +1702,7 @@ Perl_is_utf8_valid_partial_char_flags(const U8 * const s, const U8 * const e, co
         return FALSE;
     }
 
-    return cBOOL(_is_utf8_char_helper(s, e, flags));
+    return cBOOL(is_utf8_char_helper(s, e, flags));
 }
 
 /*
diff --git a/proto.h b/proto.h
index fbae508..4a3e0aa 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -98,12 +98,6 @@ PERL_CALLCONV bool   Perl__is_utf8_FOO_with_len(pTHX_ const U8 classnum, const U8
 #define PERL_ARGS_ASSERT__IS_UTF8_FOO_WITH_LEN \
        assert(p); assert(e)
 
-PERL_CALLCONV STRLEN   Perl__is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
-                       __attribute__warn_unused_result__
-                       __attribute__pure__;
-#define PERL_ARGS_ASSERT__IS_UTF8_CHAR_HELPER  \
-       assert(s); assert(e)
-
 PERL_CALLCONV bool     Perl__is_utf8_idcont(pTHX_ const U8 *p)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT__IS_UTF8_IDCONT       \
@@ -1892,6 +1886,12 @@ PERL_CALLCONV STRLEN     Perl_is_utf8_char_buf(const U8 *buf, const U8 *buf_end);
 #define PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF      \
        assert(buf); assert(buf_end)
 #endif
+PERL_CALLCONV STRLEN   Perl_is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
+                       __attribute__warn_unused_result__
+                       __attribute__pure__;
+#define PERL_ARGS_ASSERT_IS_UTF8_CHAR_HELPER   \
+       assert(s); assert(e)
+
 #ifndef NO_MATHOMS
 PERL_CALLCONV bool     Perl_is_utf8_cntrl(pTHX_ const U8 *p)
                        __attribute__deprecated__
diff --git a/utf8.c b/utf8.c
index b06f6d3..9f5f59e 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -921,7 +921,7 @@ S_does_utf8_overflow(const U8 * const s,
 #undef FF_OVERLONG_PREFIX
 
 STRLEN
-Perl__is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
+Perl_is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
 {
     STRLEN len;
     const U8 *x;
@@ -958,7 +958,7 @@ Perl__is_utf8_char_helper(const U8 * const s, const U8 * e, const U32 flags)
      *
      */
 
-    PERL_ARGS_ASSERT__IS_UTF8_CHAR_HELPER;
+    PERL_ARGS_ASSERT_IS_UTF8_CHAR_HELPER;
 
     assert(0 == (flags & ~(UTF8_DISALLOW_ILLEGAL_INTERCHANGE
                           |UTF8_DISALLOW_PERL_EXTENDED)));
diff --git a/utf8.h b/utf8.h
index 3e35860..61444d5 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -851,14 +851,14 @@ fit in an IV on the current machine.
                     && (    NATIVE_UTF8_TO_I8(*(s)) >  0xF9                 \
                         || (NATIVE_UTF8_TO_I8(*((s) + 1)) >= 0xA2))         \
                     &&  LIKELY((s) + UTF8SKIP(s) <= (e)))                   \
-                    ? _is_utf8_char_helper(s, s + UTF8SKIP(s), 0) : 0)
+                    ?  is_utf8_char_helper(s, s + UTF8SKIP(s), 0) : 0)
 #else
 #   define UTF8_IS_SUPER(s, e)                                              \
                    ((    LIKELY((e) > (s) + 3)                              \
                      &&  (*(U8*) (s)) >= 0xF4                               \
                      && ((*(U8*) (s)) >  0xF4 || (*((U8*) (s) + 1) >= 0x90))\
                      &&  LIKELY((s) + UTF8SKIP(s) <= (e)))                  \
-                    ? _is_utf8_char_helper(s, s + UTF8SKIP(s), 0) : 0)
+                    ?  is_utf8_char_helper(s, s + UTF8SKIP(s), 0) : 0)
 #endif
 
 /* These are now machine generated, and the 'given' clause is no longer
@@ -1029,7 +1029,7 @@ L</is_utf8_string_loclen_flags> to check entire strings.
       ? 1                                                                   \
       : UNLIKELY(((e) - (s)) < UTF8SKIP(s))                                 \
         ? 0                                                                 \
-        : _is_utf8_char_helper(s, e, flags))
+        : is_utf8_char_helper(s, e, flags))
 
 /* Do not use; should be deprecated.  Use isUTF8_CHAR() instead; this is
  * retained solely for backwards compatibility */