Skip to content

Commit 0a08895

Browse files
committed
Rm Perl_sv_pv(byte)? from mathoms
These functions can be converted to call their plain macro equivalents without changing their behavior. I verified this by eyeballing their implementations in mathoms.c and comparing that with what happens with just the plain macros. That means embed.fnc can be changed to generate the Perl_ forms automatically, and the mathoms functions can be removed.
1 parent 644b467 commit 0a08895

File tree

4 files changed

+11
-49
lines changed

4 files changed

+11
-49
lines changed

embed.fnc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,10 +3305,10 @@ Adp |STRLEN |sv_pos_u2b_flags \
33053305
|U32 flags
33063306
Admp |char * |sv_2pv |NN SV *sv \
33073307
|NULLOK STRLEN *lp
3308-
CMRbdp |char * |sv_pv |NN SV *sv
3308+
Cdmp |char * |sv_pv |NN SV *sv
33093309
Admp |char * |sv_2pvbyte |NN SV *sv \
33103310
|NULLOK STRLEN * const lp
3311-
CMRdp |char * |sv_pvbyte |NN SV *sv
3311+
CRdmp |char * |sv_pvbyte |NN SV *sv
33123312
Adp |char * |sv_2pvbyte_flags \
33133313
|NN SV *sv \
33143314
|NULLOK STRLEN * const lp \

embed.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,8 @@
23192319
# define Perl_sv_force_normal(mTHX,a) sv_force_normal(a)
23202320
# define Perl_sv_insert(mTHX,a,b,c,d,e) sv_insert(a,b,c,d,e)
23212321
# define Perl_sv_mortalcopy(mTHX,a) sv_mortalcopy(a)
2322+
# define Perl_sv_pv(mTHX,a) sv_pv(a)
2323+
# define Perl_sv_pvbyte(mTHX,a) sv_pvbyte(a)
23222324
# define Perl_sv_pvn_force(mTHX,a,b) sv_pvn_force(a,b)
23232325
# define Perl_sv_pvutf8(mTHX,a) sv_pvutf8(a)
23242326
# define Perl_sv_setsv(mTHX,a,b) sv_setsv(a,b)
@@ -2381,6 +2383,8 @@
23812383
# define Perl_sv_force_normal sv_force_normal
23822384
# define Perl_sv_insert sv_insert
23832385
# define Perl_sv_mortalcopy sv_mortalcopy
2386+
# define Perl_sv_pv sv_pv
2387+
# define Perl_sv_pvbyte sv_pvbyte
23842388
# define Perl_sv_pvn_force sv_pvn_force
23852389
# define Perl_sv_pvutf8 sv_pvutf8
23862390
# define Perl_sv_setsv sv_setsv

mathoms.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -82,43 +82,6 @@ Perl_ref(pTHX_ OP *o, I32 type)
8282
return doref(o, type, TRUE);
8383
}
8484

85-
/*
86-
=for apidoc_section $SV
87-
=for apidoc sv_pv
88-
89-
Use the C<SvPV_nolen> macro instead
90-
91-
=cut
92-
*/
93-
94-
/* sv_pv() is now a macro using SvPV_nolen();
95-
* this function provided for binary compatibility only
96-
*/
97-
98-
char *
99-
Perl_sv_pv(pTHX_ SV *sv)
100-
{
101-
PERL_ARGS_ASSERT_SV_PV;
102-
103-
if (SvPOK(sv))
104-
return SvPVX(sv);
105-
106-
return sv_2pv(sv, NULL);
107-
}
108-
109-
/* sv_pvbyte () is now a macro using Perl_sv_2pv_flags();
110-
* this function provided for binary compatibility only
111-
*/
112-
113-
char *
114-
Perl_sv_pvbyte(pTHX_ SV *sv)
115-
{
116-
PERL_ARGS_ASSERT_SV_PVBYTE;
117-
118-
(void)sv_utf8_downgrade(sv, FALSE);
119-
return sv_pv(sv);
120-
}
121-
12285
#if defined(HUGE_VAL) || (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL))
12386
/*
12487
* This hack is to force load of "huge" support from libm.a

proto.h

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

0 commit comments

Comments
 (0)