Skip to content

Commit 3f231b4

Browse files
committed
Convert uv_to_utf8 and kin to inline functions
These used the ill-advised mTHX construct which is being entirely removed.
1 parent 03ff823 commit 3f231b4

File tree

5 files changed

+51
-33
lines changed

5 files changed

+51
-33
lines changed

embed.fnc

+6-6
Original file line numberDiff line numberDiff line change
@@ -3837,13 +3837,13 @@ p |void |utilize |int aver \
38373837
|NN OP *idop \
38383838
|NULLOK OP *arg
38393839

3840-
Admp |U8 * |uvchr_to_utf8 |NN U8 *d \
3840+
Adm |U8 * |uvchr_to_utf8 |NN U8 *d \
38413841
|UV uv
3842-
Admp |U8 * |uvchr_to_utf8_flags \
3842+
Adm |U8 * |uvchr_to_utf8_flags \
38433843
|NN U8 *d \
38443844
|UV uv \
38453845
|UV flags
3846-
Admp |U8 * |uvchr_to_utf8_flags_msgs \
3846+
Adm |U8 * |uvchr_to_utf8_flags_msgs \
38473847
|NN U8 *d \
38483848
|UV uv \
38493849
|UV flags \
@@ -3858,13 +3858,13 @@ Cp |U8 * |uvoffuni_to_utf8_flags_msgs \
38583858
|const UV flags \
38593859
|NULLOK HV **msgs
38603860

3861-
Admp |U8 * |uv_to_utf8 |NN U8 *d \
3861+
Adip |U8 * |uv_to_utf8 |NN U8 *d \
38623862
|UV uv
3863-
Admp |U8 * |uv_to_utf8_flags \
3863+
Adip |U8 * |uv_to_utf8_flags \
38643864
|NN U8 *d \
38653865
|UV uv \
38663866
|UV flags
3867-
Admp |U8 * |uv_to_utf8_msgs|NN U8 *d \
3867+
Adip |U8 * |uv_to_utf8_msgs|NN U8 *d \
38683868
|UV uv \
38693869
|UV flags \
38703870
|NULLOK HV **msgs

embed.h

+3-6
Original file line numberDiff line numberDiff line change
@@ -823,12 +823,9 @@
823823
# define utf8n_to_uvchr Perl_utf8n_to_uvchr
824824
# define utf8n_to_uvchr_error Perl_utf8n_to_uvchr_error
825825
# define utf8n_to_uvchr_msgs Perl_utf8n_to_uvchr_msgs
826-
# define uv_to_utf8(a,b) Perl_uv_to_utf8(aTHX,a,b)
827-
# define uv_to_utf8_flags(a,b,c) Perl_uv_to_utf8_flags(aTHX,a,b,c)
828-
# define uv_to_utf8_msgs(a,b,c,d) Perl_uv_to_utf8_msgs(aTHX,a,b,c,d)
829-
# define uvchr_to_utf8(a,b) Perl_uvchr_to_utf8(aTHX,a,b)
830-
# define uvchr_to_utf8_flags(a,b,c) Perl_uvchr_to_utf8_flags(aTHX,a,b,c)
831-
# define uvchr_to_utf8_flags_msgs(a,b,c,d) Perl_uvchr_to_utf8_flags_msgs(aTHX,a,b,c,d)
826+
# define uv_to_utf8(a,b) Perl_uv_to_utf8(aTHX_ a,b)
827+
# define uv_to_utf8_flags(a,b,c) Perl_uv_to_utf8_flags(aTHX_ a,b,c)
828+
# define uv_to_utf8_msgs(a,b,c,d) Perl_uv_to_utf8_msgs(aTHX_ a,b,c,d)
832829
# define uvoffuni_to_utf8_flags_msgs(a,b,c,d) Perl_uvoffuni_to_utf8_flags_msgs(aTHX_ a,b,c,d)
833830
# define valid_identifier_pve(a,b,c) Perl_valid_identifier_pve(aTHX_ a,b,c)
834831
# define valid_identifier_pvn(a,b,c) Perl_valid_identifier_pvn(aTHX_ a,b,c)

inline.h

+18
Original file line numberDiff line numberDiff line change
@@ -3272,6 +3272,24 @@ Perl_utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
32723272
return 0;
32733273
}
32743274

3275+
PERL_STATIC_INLINE U8 *
3276+
Perl_uv_to_utf8(pTHX_ U8 *d, UV uv)
3277+
{
3278+
return uv_to_utf8_msgs(d, uv, 0, 0);
3279+
}
3280+
3281+
PERL_STATIC_INLINE U8 *
3282+
Perl_uv_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
3283+
{
3284+
return uv_to_utf8_msgs(d, uv, flags, 0);
3285+
}
3286+
3287+
PERL_STATIC_INLINE U8 *
3288+
Perl_uv_to_utf8_msgs(pTHX_ U8 *d, UV uv, UV flags , HV **msgs)
3289+
{
3290+
return uvoffuni_to_utf8_flags_msgs(d, NATIVE_TO_UNI(uv), flags, msgs);
3291+
}
3292+
32753293
/* ------------------------------- perl.h ----------------------------- */
32763294

32773295
/*

proto.h

+18-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utf8.h

+6-9
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ typedef enum {
142142
#define uvoffuni_to_utf8_flags(d,uv,flags) \
143143
uvoffuni_to_utf8_flags_msgs(d, uv, flags, 0)
144144

145-
#define Perl_uv_to_utf8(mTHX, d, u) \
146-
Perl_uv_to_utf8_flags(aTHX, d, u, 0)
147-
#define Perl_uv_to_utf8_flags(mTHX, d, u, f) \
148-
Perl_uv_to_utf8_msgs(aTHX, d, u, f, 0)
149-
#define Perl_uv_to_utf8_msgs(mTHX, d, u, f , m) \
150-
Perl_uvoffuni_to_utf8_flags_msgs(aTHX_ d, NATIVE_TO_UNI(u), f, m)
145+
#define uvchr_to_utf8 uv_to_utf8
146+
#define uvchr_to_utf8_flags uv_to_utf8_flags
147+
#define uvchr_to_utf8_flags_msgs uv_to_utf8_msgs
148+
#define Perl_uvchr_to_utf8 Perl_uv_to_utf8
149+
#define Perl_uvchr_to_utf8_flags Perl_uv_to_utf8_flags
150+
#define Perl_uvchr_to_utf8_flags_msgs Perl_uv_to_utf8_msgs
151151

152152
/* This is needed to cast the parameters for all those calls that had them
153153
* improperly as chars */
@@ -173,9 +173,6 @@ typedef enum {
173173
#define Perl_c9strict_utf8_to_uv(s, e, cp_p, advance_p) \
174174
Perl_utf8_to_uv_flags( s, e, cp_p, advance_p, \
175175
UTF8_DISALLOW_ILLEGAL_C9_INTERCHANGE)
176-
#define Perl_uvchr_to_utf8 Perl_uv_to_utf8
177-
#define Perl_uvchr_to_utf8_flags Perl_uv_to_utf8_flags
178-
#define Perl_uvchr_to_utf8_flags_msgs Perl_uv_to_utf8_msgs
179176

180177
#define utf16_to_utf8(p, d, bytelen, newlen) \
181178
utf16_to_utf8_base(p, d, bytelen, newlen, 0, 1)

0 commit comments

Comments
 (0)