Skip to content

Commit ed58924

Browse files
committed
Replace two stub functions in utf8.c with macros
This uses the new mechanism introduced in the previous commit.
1 parent 90f4e9b commit ed58924

File tree

5 files changed

+17
-30
lines changed

5 files changed

+17
-30
lines changed

embed.fnc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3744,13 +3744,13 @@ p |void |utilize |int aver \
37443744
|NN OP *idop \
37453745
|NULLOK OP *arg
37463746

3747-
Adm |U8 * |uvchr_to_utf8 |NN U8 *d \
3747+
Admp |U8 * |uvchr_to_utf8 |NN U8 *d \
37483748
|UV uv
3749-
Adm |U8 * |uvchr_to_utf8_flags \
3749+
Admp |U8 * |uvchr_to_utf8_flags \
37503750
|NN U8 *d \
37513751
|UV uv \
37523752
|UV flags
3753-
Adm |U8 * |uvchr_to_utf8_flags_msgs \
3753+
Admp |U8 * |uvchr_to_utf8_flags_msgs \
37543754
|NN U8 *d \
37553755
|UV uv \
37563756
|UV flags \

embed.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,9 @@
796796
# define utf8_to_bytes(a,b) Perl_utf8_to_bytes(aTHX_ a,b)
797797
# define utf8_to_uvchr_buf_helper(a,b,c) Perl_utf8_to_uvchr_buf_helper(aTHX_ a,b,c)
798798
# define utf8n_to_uvchr_msgs Perl_utf8n_to_uvchr_msgs
799+
# define uvchr_to_utf8(a,b) Perl_uvchr_to_utf8(aTHX,a,b)
800+
# define uvchr_to_utf8_flags(a,b,c) Perl_uvchr_to_utf8_flags(aTHX,a,b,c)
801+
# define uvchr_to_utf8_flags_msgs(a,b,c,d) Perl_uvchr_to_utf8_flags_msgs(aTHX,a,b,c,d)
799802
# define uvoffuni_to_utf8_flags_msgs(a,b,c,d) Perl_uvoffuni_to_utf8_flags_msgs(aTHX_ a,b,c,d)
800803
# define valid_utf8_to_uvchr Perl_valid_utf8_to_uvchr
801804
# define vcmp(a,b) Perl_vcmp(aTHX_ a,b)

proto.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utf8.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -454,24 +454,6 @@ The new names accurately describe the situation in all cases.
454454
=cut
455455
*/
456456

457-
/* This is also a macro */
458-
PERL_CALLCONV U8* Perl_uvchr_to_utf8(pTHX_ U8 *d, UV uv);
459-
460-
U8 *
461-
Perl_uvchr_to_utf8(pTHX_ U8 *d, UV uv)
462-
{
463-
return uvchr_to_utf8(d, uv);
464-
}
465-
466-
/* This is also a macro */
467-
PERL_CALLCONV U8* Perl_uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags);
468-
469-
U8 *
470-
Perl_uvchr_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
471-
{
472-
return uvchr_to_utf8_flags(d, uv, flags);
473-
}
474-
475457
PERL_STATIC_INLINE int
476458
S_is_utf8_overlong(const U8 * const s, const STRLEN len)
477459
{

utf8.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,14 @@ typedef enum {
136136

137137
#define uvoffuni_to_utf8_flags(d,uv,flags) \
138138
uvoffuni_to_utf8_flags_msgs(d, uv, flags, 0)
139-
#define uvchr_to_utf8(a,b) uvchr_to_utf8_flags(a,b,0)
140-
#define uvchr_to_utf8_flags(d,uv,flags) \
141-
uvchr_to_utf8_flags_msgs(d,uv,flags, 0)
142-
#define uvchr_to_utf8_flags_msgs(d,uv,flags,msgs) \
143-
uvoffuni_to_utf8_flags_msgs(d,NATIVE_TO_UNI(uv),flags, msgs)
144-
#define utf8_to_uvchr_buf(s, e, lenp) \
139+
140+
#define Perl_uvchr_to_utf8(mTHX, d, u) \
141+
Perl_uvchr_to_utf8_flags(aTHX, d, u, 0)
142+
#define Perl_uvchr_to_utf8_flags(mTHX, d, u, f) \
143+
Perl_uvchr_to_utf8_flags_msgs(aTHX, d, u, f, 0)
144+
#define Perl_uvchr_to_utf8_flags_msgs(mTHX, d, u, f , m) \
145+
Perl_uvoffuni_to_utf8_flags_msgs(aTHX_ d, NATIVE_TO_UNI(u), f, m)
146+
#define utf8_to_uvchr_buf(s, e, lenp) \
145147
utf8_to_uvchr_buf_helper((const U8 *) (s), (const U8 *) e, lenp)
146148
#define utf8n_to_uvchr(s, len, lenp, flags) \
147149
utf8n_to_uvchr_error(s, len, lenp, flags, 0)

0 commit comments

Comments
 (0)