Skip to content

Commit

Permalink
Rmv leading underscore from macro name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
khwilliamson committed Dec 11, 2019
1 parent cd9d511 commit d1c7f34
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,8 +1156,8 @@
#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)
Expand Down
6 changes: 3 additions & 3 deletions proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
Expand Down
4 changes: 2 additions & 2 deletions toke.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit d1c7f34

Please sign in to comment.