From 8decb8ab1aa0aa96ffbe39a21a2e85cf85ca074f Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 14 Aug 2025 15:23:11 -0600 Subject: [PATCH] Convert _byte_dump_string() to legal name --- embed.fnc | 2 +- embed.h | 2 +- locale.c | 12 ++++++------ op.c | 6 +++--- proto.h | 8 ++++---- regcomp_debug.c | 2 +- utf8.c | 26 +++++++++++++------------- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/embed.fnc b/embed.fnc index 23614d1275..23af64c288 100644 --- a/embed.fnc +++ b/embed.fnc @@ -806,7 +806,7 @@ p |OP * |build_infix_plugin \ |NN OP *lhs \ |NN OP *rhs \ |NN void *tokendata -EXp |const char *|_byte_dump_string \ +EXp |const char *|byte_dump_string_ \ |NULLOK const U8 * const start \ |const STRLEN len \ |const bool format diff --git a/embed.h b/embed.h index 3ccf89db85..4b2d0b8faf 100644 --- a/embed.h +++ b/embed.h @@ -1798,10 +1798,10 @@ # endif # endif /* defined(PERL_CORE) */ # if defined(PERL_CORE) || defined(PERL_EXT) -# define _byte_dump_string(a,b,c) Perl__byte_dump_string(aTHX_ a,b,c) # define _inverse_folds(a,b,c) Perl__inverse_folds(aTHX_ a,b,c) # define append_utf8_from_native_byte Perl_append_utf8_from_native_byte # define av_reify(a) Perl_av_reify(aTHX_ a) +# define byte_dump_string_(a,b,c) Perl_byte_dump_string_(aTHX_ a,b,c) # define cntrl_to_mnemonic Perl_cntrl_to_mnemonic # define current_re_engine() Perl_current_re_engine(aTHX) # define cv_ckproto_len_flags(a,b,c,d,e) Perl_cv_ckproto_len_flags(aTHX_ a,b,c,d,e) diff --git a/locale.c b/locale.c index b93526ba09..5eed234b9a 100644 --- a/locale.c +++ b/locale.c @@ -4779,7 +4779,7 @@ S_get_locale_string_utf8ness_i(pTHX_ const char * string, " index=%u(%s), string=%s, known_utf8=%d\n", locale, cat_index, category_names[cat_index], ((string) - ? _byte_dump_string((U8 *) string, + ? byte_dump_string_((U8 *) string, strlen(string), 0) : "nil"), @@ -5088,7 +5088,7 @@ S_save_to_buffer(pTHX_ const char * string, char **buf, Size_t *buf_size) "Copying '%s' to 0x%p\n", ((is_strict_utf8_string((U8 *) string, 0)) ? string - :_byte_dump_string((U8 *) string, strlen(string), 0)), + :byte_dump_string_((U8 *) string, strlen(string), 0)), *buf)); # ifdef USE_LOCALE_CTYPE @@ -6695,7 +6695,7 @@ S_langinfo_sv_i(pTHX_ locale_panic_(form( "Can't find separator in ALT_DIGITS" " representation '%s' for locale '%s'", - _byte_dump_string((U8 *) retval, + byte_dump_string_((U8 *) retval, total_len, 0), locale)); } @@ -8683,7 +8683,7 @@ S_strftime8(pTHX_ const char * fmt, fmt, ((is_strict_utf8_string((U8 *) SvPVX(sv), 0)) ? SvPVX(sv) - :_byte_dump_string((U8 *) SvPVX(sv), SvCUR(sv) ,0)), + :byte_dump_string_((U8 *) SvPVX(sv), SvCUR(sv) ,0)), *result_utf8ness)); Safefree(free_me); return true; @@ -10178,7 +10178,7 @@ Perl_mem_collxfrm_(pTHX_ const char *input_string, DEBUG_L(PerlIO_printf(Perl_debug_log, "strxfrm failed for LC_COLLATE=%s; errno=%d, input=%s\n", PL_collation_name, errno, - _byte_dump_string((U8 *) s, len, 0))); + byte_dump_string_((U8 *) s, len, 0))); goto bad; } @@ -10340,7 +10340,7 @@ S_print_collxfrm_input_and_return(pTHX_ ? "(null)" : ((xlen == 0) ? "(empty)" - : _byte_dump_string((U8 *) xbuf + COLLXFRM_HDR_LEN, + : byte_dump_string_((U8 *) xbuf + COLLXFRM_HDR_LEN, xlen, 0))), xlen); } diff --git a/op.c b/op.c index c254470711..cb232fa861 100644 --- a/op.c +++ b/op.c @@ -6569,7 +6569,7 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d: tstr before inversion=\n%s\n", - __FILE__, __LINE__, _byte_dump_string(t, tend - t, 0))); + __FILE__, __LINE__, byte_dump_string_(t, tend - t, 0))); while (t < tend) { @@ -6732,9 +6732,9 @@ S_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) t_range_count = r_range_count = 0; DEBUG_y(PerlIO_printf(Perl_debug_log, "%s: %d:\ntstr=%s\n", - __FILE__, __LINE__, _byte_dump_string(t, tend - t, 0))); + __FILE__, __LINE__, byte_dump_string_(t, tend - t, 0))); DEBUG_y(PerlIO_printf(Perl_debug_log, "rstr=%s\n", - _byte_dump_string(r, rend - r, 0))); + byte_dump_string_(r, rend - r, 0))); DEBUG_y(PerlIO_printf(Perl_debug_log, "/c=%d; /s=%d; /d=%d\n" " At the beginning of pass %u\n", complement, squash, del, diff --git a/proto.h b/proto.h index 8dee442e08..2edc4d2bb8 100644 --- a/proto.h +++ b/proto.h @@ -88,8 +88,6 @@ Perl_Slab_Free(pTHX_ void *op); /* PERL_CALLCONV void Perl_SvREFCNT_dec_set_NULL(pTHX_ SV *sv); */ -#define PERL_ARGS_ASSERT__BYTE_DUMP_STRING - #define PERL_ARGS_ASSERT__INVERSE_FOLDS \ assert(first_folds_to); assert(remaining_folds_to) @@ -388,6 +386,8 @@ Perl_build_infix_plugin(pTHX_ OP *lhs, OP *rhs, void *tokendata) #define PERL_ARGS_ASSERT_BUILD_INFIX_PLUGIN \ assert(lhs); assert(rhs); assert(tokendata) +#define PERL_ARGS_ASSERT_BYTE_DUMP_STRING_ + PERL_CALLCONV int Perl_bytes_cmp_utf8(pTHX_ const U8 *b, STRLEN blen, const U8 *u, STRLEN ulen); #define PERL_ARGS_ASSERT_BYTES_CMP_UTF8 \ @@ -6039,14 +6039,14 @@ S_should_warn_nl(const char *pv) # endif #endif /* defined(PERL_CORE) */ #if defined(PERL_CORE) || defined(PERL_EXT) -PERL_CALLCONV const char * -Perl__byte_dump_string(pTHX_ const U8 * const start, const STRLEN len, const bool format); PERL_CALLCONV Size_t Perl__inverse_folds(pTHX_ const UV cp, U32 *first_folds_to, const U32 **remaining_folds_to) __attribute__warn_unused_result__; PERL_CALLCONV void Perl_av_reify(pTHX_ AV *av); PERL_CALLCONV const char * +Perl_byte_dump_string_(pTHX_ const U8 * const start, const STRLEN len, const bool format); +PERL_CALLCONV const char * Perl_cntrl_to_mnemonic(const U8 c) __attribute__warn_unused_result__; PERL_CALLCONV regexp_engine const * diff --git a/regcomp_debug.c b/regcomp_debug.c index 218908f1da..805ca7f31f 100644 --- a/regcomp_debug.c +++ b/regcomp_debug.c @@ -946,7 +946,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o, const regmatch_ if (op == ANYOFHs) { sv_catpvf(sv, " (Leading UTF-8 bytes = %s", - _byte_dump_string((U8 *) ((struct regnode_anyofhs *) o)->string, + byte_dump_string_((U8 *) ((struct regnode_anyofhs *) o)->string, FLAGS(o), 1)); } else if (REGNODE_TYPE(op) != ANYOF) { diff --git a/utf8.c b/utf8.c index 20398ee514..4d55c43155 100644 --- a/utf8.c +++ b/utf8.c @@ -885,7 +885,7 @@ Perl_is_utf8_FF_helper_(const U8 * const s0, const U8 * const e, } const char * -Perl__byte_dump_string(pTHX_ const U8 * const start, const STRLEN len, const bool format) +Perl_byte_dump_string_(pTHX_ const U8 * const start, const STRLEN len, const bool format) { /* Returns a mortalized C string that is a displayable copy of the 'len' * bytes starting at 'start'. 'format' gives how to display each byte. @@ -905,7 +905,7 @@ Perl__byte_dump_string(pTHX_ const U8 * const start, const STRLEN len, const boo char * output; char * d; - PERL_ARGS_ASSERT__BYTE_DUMP_STRING; + PERL_ARGS_ASSERT_BYTE_DUMP_STRING_; Newx(output, output_len, char); SAVEFREEPV(output); @@ -985,7 +985,7 @@ S_unexpected_non_continuation_text(pTHX_ const U8 * const s, return form("%s: %s (unexpected non-continuation byte 0x%02x," " %s after start byte 0x%02x; need %d bytes, got %d)", malformed_text, - _byte_dump_string(s, x - s, 0), + byte_dump_string_(s, x - s, 0), *(s + non_cont_byte_pos), where, *s, @@ -2249,7 +2249,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, "%s: %s (unexpected continuation byte 0x%02x," " with no preceding start byte)", malformed_text, - _byte_dump_string(s0, 1, 0), + byte_dump_string_(s0, 1, 0), *s0); break; @@ -2258,7 +2258,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, message = form( "%s: %s (too short; %d byte%s available, need %d)", malformed_text, - _byte_dump_string(s0, avail_len, 0), + byte_dump_string_(s0, avail_len, 0), (int)avail_len, avail_len == 1 ? "" : "s", /* Pluralize */ (int)expectlen); @@ -2296,8 +2296,8 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, " \"%s\" is overlong which can and should be" " represented with a different, shorter sequence)", malformed_text, - _byte_dump_string(s0, send - s0, 0), - _byte_dump_string(s0, curlen, 0)); + byte_dump_string_(s0, send - s0, 0), + byte_dump_string_(s0, curlen, 0)); } else { U8 tmpbuf[UTF8_MAXBYTES+1]; @@ -2317,8 +2317,8 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, "%s: %s (overlong; instead use %s to represent" " %s%0*" UVXf ")", malformed_text, - _byte_dump_string(s0, avail_len, 0), - _byte_dump_string(tmpbuf, e - tmpbuf, 0), + byte_dump_string_(s0, avail_len, 0), + byte_dump_string_(tmpbuf, e - tmpbuf, 0), preface, ((input_uv < 256) ? 2 : 4), /* Field width of 2 for small code @@ -2366,7 +2366,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, message = Perl_form(aTHX_ "UTF-16 surrogate (any UTF-8 sequence that" " starts with \"%s\" is for a surrogate)", - _byte_dump_string(s0, curlen, 0)); + byte_dump_string_(s0, curlen, 0)); } else { message = Perl_form(aTHX_ surrogate_cp_format, input_uv); @@ -2456,7 +2456,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, if (overflows) { message = Perl_form(aTHX_ "%s: %s (overflows)", malformed_text, - _byte_dump_string(s0, curlen, 0)); + byte_dump_string_(s0, curlen, 0)); } else if ( (orig_problems & UTF8_GOT_TOO_SHORT) || ( UTF8_IS_PERL_EXTENDED(s0) @@ -2467,14 +2467,14 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0, "Any UTF-8 sequence that starts with" " \"%s\" is a Perl extension, and so" " is not portable", - _byte_dump_string(s0, curlen, 0)); + byte_dump_string_(s0, curlen, 0)); } else { message = Perl_form(aTHX_ "Any UTF-8 sequence that starts with" " \"%s\" is for a non-Unicode code" " point, may not be portable", - _byte_dump_string(s0, curlen, 0)); + byte_dump_string_(s0, curlen, 0)); } } else if (is_extended) {