Convert Perl_uvoffuni_to_utf8_flags to a macro

The function is hereby removed in favor of calling the plain
uvoffuni_to_utf8_flags macro that already exists
This commit is contained in:
Karl Williamson 2025-07-20 11:05:48 -06:00 committed by Karl Williamson
parent d70bab4ab8
commit 211c07b6fd
5 changed files with 20 additions and 29 deletions

View File

@ -3856,7 +3856,7 @@ Admp |U8 * |uvchr_to_utf8_flags_msgs \
|UV uv \
|UV flags \
|NULLOK HV **msgs
CMdp |U8 * |uvoffuni_to_utf8_flags \
Cdmp |U8 * |uvoffuni_to_utf8_flags \
|NN U8 *d \
|UV uv \
|UV flags

View File

@ -2372,6 +2372,7 @@
# define Perl_uvchr_to_utf8(mTHX,a,b) uvchr_to_utf8(a,b)
# define Perl_uvchr_to_utf8_flags(mTHX,a,b,c) uvchr_to_utf8_flags(a,b,c)
# define Perl_uvchr_to_utf8_flags_msgs(mTHX,a,b,c,d) uvchr_to_utf8_flags_msgs(a,b,c,d)
# define Perl_uvoffuni_to_utf8_flags(mTHX,a,b,c) uvoffuni_to_utf8_flags(a,b,c)
# define Perl_whichsig(mTHX,a) whichsig(a)
# define thread_locale_init() Perl_thread_locale_init(aTHX)
# define thread_locale_term() Perl_thread_locale_term(aTHX)
@ -2472,6 +2473,7 @@
# define Perl_uvchr_to_utf8 uvchr_to_utf8
# define Perl_uvchr_to_utf8_flags uvchr_to_utf8_flags
# define Perl_uvchr_to_utf8_flags_msgs uvchr_to_utf8_flags_msgs
# define Perl_uvoffuni_to_utf8_flags uvoffuni_to_utf8_flags
# define Perl_whichsig whichsig
# if defined(PERL_DONT_CREATE_GVSV)
# define Perl_gv_SVadd gv_SVadd

6
proto.h generated
View File

@ -5487,10 +5487,8 @@ Perl_uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags); */
/* PERL_CALLCONV U8 *
Perl_uvchr_to_utf8_flags_msgs(pTHX_ U8 *d, UV uv, UV flags, HV **msgs); */
PERL_CALLCONV U8 *
Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags);
#define PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS \
assert(d)
/* PERL_CALLCONV U8 *
Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags); */
PERL_CALLCONV U8 *
Perl_uvoffuni_to_utf8_flags_msgs(pTHX_ U8 *d, UV input_uv, const UV flags, HV **msgs);

24
utf8.c
View File

@ -105,30 +105,6 @@ S_new_msg_hv(pTHX_ const char * const message, /* The message text */
return msg_hv;
}
/*
=for apidoc uvoffuni_to_utf8_flags
THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES.
Instead, B<Almost all code should use L<perlapi/uv_to_utf8> or
L<perlapi/uv_to_utf8_flags>>.
This function is like them, but the input is a strict Unicode
(as opposed to native) code point. Only in very rare circumstances should code
not be using the native code point.
For details, see the description for L<perlapi/uv_to_utf8_flags>.
=cut
*/
U8 *
Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, const UV flags)
{
PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS;
return uvoffuni_to_utf8_flags_msgs(d, uv, flags, NULL);
}
/* All these formats take a single UV code point argument */
const char surrogate_cp_format[] = "UTF-16 surrogate U+%04" UVXf;
const char nonchar_cp_format[] = "Unicode non-character U+%04" UVXf

15
utf8.h
View File

@ -139,6 +139,21 @@ typedef enum {
#define is_ascii_string(s, len) is_utf8_invariant_string(s, len)
#define is_invariant_string(s, len) is_utf8_invariant_string(s, len)
/*
=for apidoc uvoffuni_to_utf8_flags
THIS FUNCTION SHOULD BE USED IN ONLY VERY SPECIALIZED CIRCUMSTANCES.
Instead, B<Almost all code should use L<perlapi/uv_to_utf8> or
L<perlapi/uv_to_utf8_flags>>.
This function is like them, but the input is a strict Unicode
(as opposed to native) code point. Only in very rare circumstances should code
not be using the native code point.
For details, see the description for L<perlapi/uv_to_utf8_flags>.
=cut
*/
#define uvoffuni_to_utf8_flags(d,uv,flags) \
uvoffuni_to_utf8_flags_msgs(d, uv, flags, 0)