From 348038046ec33c726fa54f69904c3af331eac760 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 29 Jun 2024 12:00:19 -0600 Subject: [PATCH] perlapi: Move macro defns to where defined This moves the API definitions of is_ascii_string, is_invariant_string, and is_utf8_invariant_string to the spots in the source code where each is #defined, thus making it easier to maintain --- embed.fnc | 8 -------- inline.h | 2 +- proto.h | 14 -------------- utf8.h | 4 ++-- 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/embed.fnc b/embed.fnc index a8865924007f..dd2ca8d7e224 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1614,8 +1614,6 @@ p |bool |io_close |NN IO *io \ |NULLOK GV *gv \ |bool is_explicit \ |bool warn_on_fail -APRTdm |bool |is_ascii_string|NN const U8 * const s \ - |STRLEN len ARTdip |Size_t |isC9_STRICT_UTF8_CHAR \ |NN const U8 * const s0 \ |NN const U8 * const e @@ -1637,9 +1635,6 @@ dp |bool |isinfnansv |NN SV *sv Cp |bool |_is_in_locale_category \ |const bool compiling \ |const int category -APRTdm |bool |is_invariant_string \ - |NN const U8 * const s \ - |STRLEN len ARdp |I32 |is_lvalue_sub : used to check for NULs in pathnames and other names ARdip |bool |is_safe_syscall|NN const char *pv \ @@ -1702,9 +1697,6 @@ ATdip |bool |is_utf8_fixed_width_buf_loclen_flags \ CRp |bool |_is_utf8_FOO |const U8 classnum \ |NN const U8 *p \ |NN const U8 * const e -ARTdmo |bool |is_utf8_invariant_string \ - |NN const U8 * const s \ - |STRLEN len ARTdip |bool |is_utf8_invariant_string_loc \ |NN const U8 * const s \ |STRLEN len \ diff --git a/inline.h b/inline.h index 8f3141ea623b..3dfddd96abc7 100644 --- a/inline.h +++ b/inline.h @@ -1310,7 +1310,7 @@ so the name C is preferred. See also C> and C>. -=for apidoc_defn is_utf8_invariant_string bool|NN const U8 * const s|STRLEN len +=for apidoc_defn ARTm|bool|is_utf8_invariant_string|NN const U8 * const s|STRLEN len =cut diff --git a/proto.h b/proto.h index 405b04b7fb52..5dfde8c457bb 100644 --- a/proto.h +++ b/proto.h @@ -1814,11 +1814,6 @@ Perl_io_close(pTHX_ IO *io, GV *gv, bool is_explicit, bool warn_on_fail) #define PERL_ARGS_ASSERT_IO_CLOSE \ assert(io) -/* PERL_CALLCONV bool -is_ascii_string(const U8 * const s, STRLEN len) - __attribute__warn_unused_result__ - __attribute__pure__; */ - /* PERL_CALLCONV bool is_c9strict_utf8_string(const U8 *s, STRLEN len) __attribute__warn_unused_result__; */ @@ -1826,11 +1821,6 @@ is_c9strict_utf8_string(const U8 *s, STRLEN len) /* PERL_CALLCONV bool is_c9strict_utf8_string_loc(const U8 *s, STRLEN len, const U8 **ep); */ -/* PERL_CALLCONV bool -is_invariant_string(const U8 * const s, STRLEN len) - __attribute__warn_unused_result__ - __attribute__pure__; */ - PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX) __attribute__warn_unused_result__; @@ -1863,10 +1853,6 @@ is_utf8_fixed_width_buf_flags(const U8 * const s, STRLEN len, const U32 flags); /* PERL_CALLCONV bool is_utf8_fixed_width_buf_loc_flags(const U8 * const s, STRLEN len, const U8 **ep, const U32 flags); */ -/* PERL_CALLCONV bool -is_utf8_invariant_string(const U8 * const s, STRLEN len) - __attribute__warn_unused_result__; */ - /* PERL_CALLCONV bool is_utf8_string(const U8 *s, STRLEN len) __attribute__warn_unused_result__; */ diff --git a/utf8.h b/utf8.h index 5df7a02043f8..bc6bc44e0f9e 100644 --- a/utf8.h +++ b/utf8.h @@ -127,8 +127,8 @@ typedef enum { #define FOLD_FLAGS_NOMIX_ASCII 0x4 /* -=for apidoc_defn is_ascii_string bool|NN const U8 * const s|STRLEN len -=for apidoc_defn is_invariant_string bool|NN const U8 * const s|STRLEN len +=for apidoc_defn APRTdm|bool|is_ascii_string|NN const U8 * const s|STRLEN len +=for apidoc_defn APRTdm|bool|is_invariant_string|NN const U8 * const s|STRLEN len =cut */ #define is_ascii_string(s, len) is_utf8_invariant_string(s, len)