Skip to content

Commit 10e38d9

Browse files
committed
Rm Perl_sv_pvutf8() from mathoms
This function can be converted to call plain sv_pvutf8 without changing its behavior. I verified this by eyeballing its implementation in mathoms.c and comparing that with what happens with just the plain macro. That means embed.fnc can be changed to generate the Perl_ form automatically, and the mathoms function can be removed.
1 parent a810de6 commit 10e38d9

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

embed.fnc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3337,7 +3337,7 @@ Adp |char * |sv_pvn_force_flags \
33373337
CRdmp |char * |sv_2pv_nolen |NN SV *sv
33383338
Admp |char * |sv_2pvutf8 |NN SV *sv \
33393339
|NULLOK STRLEN * const lp
3340-
CMRbdp |char * |sv_pvutf8 |NN SV *sv
3340+
CRdmp |char * |sv_pvutf8 |NN SV *sv
33413341
Adp |char * |sv_2pvutf8_flags \
33423342
|NN SV *sv \
33433343
|NULLOK STRLEN * const lp \

embed.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,7 @@
23192319
# define Perl_sv_insert(mTHX,a,b,c,d,e) sv_insert(a,b,c,d,e)
23202320
# define Perl_sv_mortalcopy(mTHX,a) sv_mortalcopy(a)
23212321
# define Perl_sv_pvn_force(mTHX,a,b) sv_pvn_force(a,b)
2322+
# define Perl_sv_pvutf8(mTHX,a) sv_pvutf8(a)
23222323
# define Perl_sv_setsv(mTHX,a,b) sv_setsv(a,b)
23232324
# define Perl_sv_taint(mTHX,a) sv_taint(a)
23242325
# define Perl_sv_unref(mTHX,a) sv_unref(a)
@@ -2379,6 +2380,7 @@
23792380
# define Perl_sv_insert sv_insert
23802381
# define Perl_sv_mortalcopy sv_mortalcopy
23812382
# define Perl_sv_pvn_force sv_pvn_force
2383+
# define Perl_sv_pvutf8 sv_pvutf8
23822384
# define Perl_sv_setsv sv_setsv
23832385
# define Perl_sv_taint sv_taint
23842386
# define Perl_sv_unref sv_unref

mathoms.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,6 @@ Perl_sv_pvbyte(pTHX_ SV *sv)
119119
return sv_pv(sv);
120120
}
121121

122-
char *
123-
Perl_sv_pvutf8(pTHX_ SV *sv)
124-
{
125-
PERL_ARGS_ASSERT_SV_PVUTF8;
126-
127-
sv_utf8_upgrade(sv);
128-
return sv_pv(sv);
129-
}
130-
131122
#if defined(HUGE_VAL) || (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL))
132123
/*
133124
* This hack is to force load of "huge" support from libm.a

proto.h

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

0 commit comments

Comments
 (0)