Skip to content

Commit

Permalink
Convert leading underscore to trailing.
Browse files Browse the repository at this point in the history
Leading underscores of global names are reserved for the C implmentation
itself.  We are gradually fixing ours to conform.
  • Loading branch information
khwilliamson committed Dec 6, 2024
1 parent 1cd1334 commit 476f5af
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions doop.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ S_do_trans_count_invmap(pTHX_ SV * const sv, AV * const invmap)
else {
from = utf8_to_uvchr_buf(s, send, &s_len);
if (from == 0 && *s != '\0') {
_force_out_malformed_utf8_message(s, send, 0, MALFORMED_UTF8_DIE);
force_out_malformed_utf8_message_(s, send, 0, MALFORMED_UTF8_DIE);
}
}

Expand Down Expand Up @@ -492,7 +492,7 @@ S_do_trans_invmap(pTHX_ SV * const sv, AV * const invmap)
else {
from = utf8_to_uvchr_buf(s, send, &s_len);
if (from == 0 && *s != '\0') {
_force_out_malformed_utf8_message(s, send, 0, MALFORMED_UTF8_DIE);
force_out_malformed_utf8_message_(s, send, 0, MALFORMED_UTF8_DIE);
}
}

Expand Down
2 changes: 1 addition & 1 deletion embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ Adpx |void |forbid_outofblock_ops \
|NN OP *o \
|NN const char *blockname
p |void |force_locale_unlock
Cp |void |_force_out_malformed_utf8_message \
Cp |void |force_out_malformed_utf8_message_ \
|NN const U8 * const p \
|NN const U8 * const e \
|const U32 flags \
Expand Down
2 changes: 1 addition & 1 deletion embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
# define SvTRUE_nomg(a) Perl_SvTRUE_nomg(aTHX_ a)
# define SvUV(a) Perl_SvUV(aTHX_ a)
# define SvUV_nomg(a) Perl_SvUV_nomg(aTHX_ a)
# define _force_out_malformed_utf8_message(a,b,c,d) Perl__force_out_malformed_utf8_message(aTHX_ a,b,c,d)
# define _is_uni_FOO(a,b) Perl__is_uni_FOO(aTHX_ a,b)
# define _is_uni_perl_idcont(a) Perl__is_uni_perl_idcont(aTHX_ a)
# define _is_uni_perl_idstart(a) Perl__is_uni_perl_idstart(aTHX_ a)
Expand Down Expand Up @@ -236,6 +235,7 @@
# define foldEQ_locale(a,b,c) Perl_foldEQ_locale(aTHX_ a,b,c)
# define foldEQ_utf8_flags(a,b,c,d,e,f,g,h,i) Perl_foldEQ_utf8_flags(aTHX_ a,b,c,d,e,f,g,h,i)
# define forbid_outofblock_ops(a,b) Perl_forbid_outofblock_ops(aTHX_ a,b)
# define force_out_malformed_utf8_message_(a,b,c,d) Perl_force_out_malformed_utf8_message_(aTHX_ a,b,c,d)
# define free_tmps() Perl_free_tmps(aTHX)
# define get_av(a,b) Perl_get_av(aTHX_ a,b)
# define get_cv(a,b) Perl_get_cv(aTHX_ a,b)
Expand Down
12 changes: 6 additions & 6 deletions handy.h
Original file line number Diff line number Diff line change
Expand Up @@ -2272,14 +2272,14 @@ END_EXTERN_C

#define generic_utf8_safe_(classnum, p, e, above_latin1) \
((! _utf8_safe_assert(p, e)) \
? (_force_out_malformed_utf8_message((U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0)\
? (force_out_malformed_utf8_message_((U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0)\
: (UTF8_IS_INVARIANT(*(p))) \
? generic_isCC_(*(p), classnum) \
: (UTF8_IS_DOWNGRADEABLE_START(*(p)) \
? ((LIKELY((e) - (p) > 1 && UTF8_IS_CONTINUATION(*((p)+1)))) \
? generic_isCC_(EIGHT_BIT_UTF8_TO_NATIVE(*(p), *((p)+1 )), \
classnum) \
: (_force_out_malformed_utf8_message( \
: (force_out_malformed_utf8_message_( \
(U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0)) \
: above_latin1))
/* Like the above, but calls 'above_latin1(p)' to get the utf8 value.
Expand All @@ -2289,7 +2289,7 @@ END_EXTERN_C
#define generic_non_invlist_utf8_safe_(classnum, above_latin1, p, e) \
generic_utf8_safe_(classnum, p, e, \
(UNLIKELY((e) - (p) < UTF8SKIP(p)) \
? (_force_out_malformed_utf8_message( \
? (force_out_malformed_utf8_message_( \
(U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0) \
: above_latin1(p)))
/* Like the above, but passes classnum to _isFOO_utf8(), instead of having an
Expand Down Expand Up @@ -2379,7 +2379,7 @@ END_EXTERN_C
#define isXDIGIT_utf8_safe(p, e) \
generic_utf8_safe_no_upper_latin1_(CC_XDIGIT_, p, e, \
(UNLIKELY((e) - (p) < UTF8SKIP(p)) \
? (_force_out_malformed_utf8_message( \
? (force_out_malformed_utf8_message_( \
(U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0) \
: is_XDIGIT_high(p)))

Expand Down Expand Up @@ -2428,7 +2428,7 @@ END_EXTERN_C
: (UTF8_IS_DOWNGRADEABLE_START(*(p)) \
? ((LIKELY((e) - (p) > 1 && UTF8_IS_CONTINUATION(*((p)+1)))) \
? macro(EIGHT_BIT_UTF8_TO_NATIVE(*(p), *((p)+1))) \
: (_force_out_malformed_utf8_message( \
: (force_out_malformed_utf8_message_( \
(U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0)) \
: above_latin1))

Expand All @@ -2442,7 +2442,7 @@ END_EXTERN_C
#define generic_LC_non_invlist_utf8_safe_(classnum, above_latin1, p, e) \
generic_LC_utf8_safe_(classnum, p, e, \
(UNLIKELY((e) - (p) < UTF8SKIP(p)) \
? (_force_out_malformed_utf8_message( \
? (force_out_malformed_utf8_message_( \
(U8 *) (p), (U8 *) (e), 0, MALFORMED_UTF8_DIE), 0) \
: above_latin1(p)))

Expand Down
2 changes: 1 addition & 1 deletion pp_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -3152,7 +3152,7 @@ PP_wrapped(pp_pack, 0, 1)
const U8 * error_pos;

if (! is_utf8_string_loc((U8 *) result, result_len, &error_pos)) {
_force_out_malformed_utf8_message(error_pos,
force_out_malformed_utf8_message_(error_pos,
(U8 *) result + result_len,
0, /* no flags */
MALFORMED_UTF8_DIE
Expand Down
10 changes: 5 additions & 5 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion regexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -10917,7 +10917,7 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const
const U32 utf8n_flags = UTF8_ALLOW_DEFAULT;
c = utf8n_to_uvchr(p, p_end - p, &c_len, utf8n_flags | UTF8_CHECK_ONLY);
if (c_len == (STRLEN)-1) {
_force_out_malformed_utf8_message(p, p_end,
force_out_malformed_utf8_message_(p, p_end,
utf8n_flags,
MALFORMED_UTF8_DIE);
NOT_REACHED; /* NOTREACHED */
Expand Down
10 changes: 5 additions & 5 deletions toke.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, U32 flags)
SvCUR(line),
&first_bad_char_loc)))
{
_force_out_malformed_utf8_message(first_bad_char_loc,
force_out_malformed_utf8_message_(first_bad_char_loc,
(U8 *) s + SvCUR(line),
0,
MALFORMED_UTF8_DIE);
Expand Down Expand Up @@ -1546,7 +1546,7 @@ Perl_lex_next_chunk(pTHX_ U32 flags)
PL_parser->bufend - PL_parser->bufptr,
&first_bad_char_loc)))
{
_force_out_malformed_utf8_message(first_bad_char_loc,
force_out_malformed_utf8_message_(first_bad_char_loc,
(U8 *) PL_parser->bufend,
0,
MALFORMED_UTF8_DIE);
Expand Down Expand Up @@ -1636,7 +1636,7 @@ Perl_lex_peek_unichar(pTHX_ U32 flags)
}
unichar = utf8n_to_uvchr((U8*)s, bufend-s, &retlen, UTF8_CHECK_ONLY);
if (retlen == (STRLEN)-1) {
_force_out_malformed_utf8_message((U8 *) s,
force_out_malformed_utf8_message_((U8 *) s,
(U8 *) bufend,
0,
MALFORMED_UTF8_DIE);
Expand Down Expand Up @@ -3023,7 +3023,7 @@ Perl_get_and_check_backslash_N_name(pTHX_ const char* s,
if (UNLIKELY(! is_utf8_string_loc((U8 *) str, len,
&first_bad_char_loc)))
{
_force_out_malformed_utf8_message(first_bad_char_loc,
force_out_malformed_utf8_message_(first_bad_char_loc,
(U8 *) PL_parser->bufend,
0,
MALFORMED_UTF8_WARN);
Expand Down Expand Up @@ -9618,7 +9618,7 @@ Perl_yylex(pTHX)
PL_bufend - PL_bufptr,
&first_bad_char_loc)))
{
_force_out_malformed_utf8_message(first_bad_char_loc,
force_out_malformed_utf8_message_(first_bad_char_loc,
(U8 *) PL_bufend,
0,
MALFORMED_UTF8_DIE);
Expand Down
12 changes: 6 additions & 6 deletions utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ within non-zero characters.
*/

void
Perl__force_out_malformed_utf8_message(pTHX_
Perl_force_out_malformed_utf8_message_(pTHX_
const U8 *const p, /* First byte in UTF-8 sequence */
const U8 * const e, /* Final byte in sequence (may include
multiple chars */
const U32 flags, /* Flags to pass to utf8_to_uv(),
usually 0, or some DISALLOW flags */
const bool die_here) /* If TRUE, this function does not return */
{
PERL_ARGS_ASSERT_FORCE_OUT_MALFORMED_UTF8_MESSAGE_;

/* This core-only function is to be called when a malformed UTF-8 character
* is found, in order to output the detailed information about the
* malformation before dieing. The reason it exists is for the occasions
Expand All @@ -69,8 +71,6 @@ Perl__force_out_malformed_utf8_message(pTHX_
* die themselves */
U32 errors;

PERL_ARGS_ASSERT__FORCE_OUT_MALFORMED_UTF8_MESSAGE;

ENTER;
SAVEI8(PL_dowarn);
SAVESPTR(PL_curcop);
Expand All @@ -86,7 +86,7 @@ Perl__force_out_malformed_utf8_message(pTHX_
LEAVE;

if (! errors) {
Perl_croak(aTHX_ "panic: _force_out_malformed_utf8_message should"
Perl_croak(aTHX_ "panic: force_out_malformed_utf8_message_ should"
" be called only when there are errors found");
}

Expand Down Expand Up @@ -3734,7 +3734,7 @@ S_is_utf8_common(pTHX_ const U8 *const p, const U8 * const e,
PERL_ARGS_ASSERT_IS_UTF8_COMMON;

if (cp == 0 && (p >= e || *p != '\0')) {
_force_out_malformed_utf8_message(p, e, 0, MALFORMED_UTF8_DIE);
force_out_malformed_utf8_message_(p, e, 0, MALFORMED_UTF8_DIE);
NOT_REACHED; /* NOTREACHED */
}

Expand Down Expand Up @@ -4279,7 +4279,7 @@ S_turkic_uc(pTHX_ const U8 * const p, const U8 * const e,
STRLEN len_result; \
result = utf8n_to_uvchr(p, e - p, &len_result, UTF8_CHECK_ONLY); \
if (len_result == (STRLEN) -1) { \
_force_out_malformed_utf8_message(p, e, 0, MALFORMED_UTF8_DIE ); \
force_out_malformed_utf8_message_(p, e, 0, MALFORMED_UTF8_DIE ); \
}

#define CASE_CHANGE_BODY_END(locale_flags, change_macro) \
Expand Down

0 comments on commit 476f5af

Please sign in to comment.