This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rmv leading underscore from macro name
authorKarl Williamson <khw@cpan.org>
Tue, 10 Dec 2019 03:27:02 +0000 (20:27 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 11 Dec 2019 14:30:17 +0000 (07:30 -0700)
These are illegal in C, but we have plenty of them around; I happened
to be looking at this function, and decided to fix it.  Note that only
the macro name is illegal; the function was fine, but to change the
macro name means changing the function one.

embed.fnc
embed.h
proto.h
regexec.c
toke.c

index 3abf957..777e532 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2761,8 +2761,8 @@ ESR       |bool   |regtail_study  |NN RExC_state_t *pRExC_state \
 EXRp   |bool   |isFOO_lc       |const U8 classnum|const U8 character
 #endif
 
-#if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C)
-ERp    |bool   |_is_grapheme   |NN const U8 * strbeg|NN const U8 * s|NN const U8 *strend|const UV cp
+#if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
+ERp    |bool   |is_grapheme    |NN const U8 * strbeg|NN const U8 * s|NN const U8 *strend|const UV cp
 #endif
 
 #if defined(PERL_IN_REGEXEC_C)
diff --git a/embed.h b/embed.h
index 21d26d6..9ee8b75 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define to_byte_substr(a)      S_to_byte_substr(aTHX_ a)
 #define to_utf8_substr(a)      S_to_utf8_substr(aTHX_ a)
 #  endif
-#  if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C)
-#define _is_grapheme(a,b,c,d)  Perl__is_grapheme(aTHX_ a,b,c,d)
+#  if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
+#define is_grapheme(a,b,c,d)   Perl_is_grapheme(aTHX_ a,b,c,d)
 #  endif
 #  if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
 #define isFOO_lc(a,b)          Perl_isFOO_lc(aTHX_ a,b)
diff --git a/proto.h b/proto.h
index 364b12e..130cdf9 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6097,10 +6097,10 @@ STATIC void     S_to_utf8_substr(pTHX_ regexp * prog);
 #define PERL_ARGS_ASSERT_TO_UTF8_SUBSTR        \
        assert(prog)
 #endif
-#if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_TOKE_C)
-PERL_CALLCONV bool     Perl__is_grapheme(pTHX_ const U8 * strbeg, const U8 * s, const U8 *strend, const UV cp)
+#if defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_TOKE_C)
+PERL_CALLCONV bool     Perl_is_grapheme(pTHX_ const U8 * strbeg, const U8 * s, const U8 *strend, const UV cp)
                        __attribute__warn_unused_result__;
-#define PERL_ARGS_ASSERT__IS_GRAPHEME  \
+#define PERL_ARGS_ASSERT_IS_GRAPHEME   \
        assert(strbeg); assert(s); assert(strend)
 
 #endif
index a61ec91..21f3972 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -10641,7 +10641,7 @@ S_to_byte_substr(pTHX_ regexp *prog)
 #ifndef PERL_IN_XSUB_RE
 
 bool
-Perl__is_grapheme(pTHX_ const U8 * strbeg, const U8 * s, const U8 * strend, const UV cp)
+Perl_is_grapheme(pTHX_ const U8 * strbeg, const U8 * s, const U8 * strend, const UV cp)
 {
     /* Temporary helper function for toke.c.  Verify that the code point 'cp'
      * is a stand-alone grapheme.  The UTF-8 for 'cp' begins at position 's' in
@@ -10657,7 +10657,7 @@ Perl__is_grapheme(pTHX_ const U8 * strbeg, const U8 * s, const U8 * strend, cons
     GCB_enum cp_gcb_val, prev_cp_gcb_val, next_cp_gcb_val;
     const U8 * prev_cp_start;
 
-    PERL_ARGS_ASSERT__IS_GRAPHEME;
+    PERL_ARGS_ASSERT_IS_GRAPHEME;
 
     if (   UNLIKELY(UNICODE_IS_SUPER(cp))
         || UNLIKELY(UNICODE_IS_NONCHAR(cp)))
diff --git a/toke.c b/toke.c
index ab358a1..6f38a59 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -11017,7 +11017,7 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
     }
     else {
        termcode = utf8_to_uvchr_buf((U8*)s, (U8*)PL_bufend, &termlen);
-        if (UTF && UNLIKELY(! _is_grapheme((U8 *) start,
+        if (UTF && UNLIKELY(! is_grapheme((U8 *) start,
                                            (U8 *) s,
                                            (U8 *) PL_bufend,
                                                   termcode)))
@@ -11089,7 +11089,7 @@ Perl_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int
                         && memEQ(s + 1, (char*)termstr + 1, termlen - 1))
                     {
                         if (   UTF
-                            && UNLIKELY(! _is_grapheme((U8 *) start,
+                            && UNLIKELY(! is_grapheme((U8 *) start,
                                                        (U8 *) s,
                                                        (U8 *) PL_bufend,
                                                               termcode)))