From 5abc721d638ff51bc38a83a3846d0b034cac3761 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 29 Oct 2005 14:51:32 +0000 Subject: [PATCH] Replace sv_force_normal with a macro that calls sv_force_normal_flags. p4raw-id: //depot/perl@25879 --- embed.fnc | 2 +- embed.h | 2 -- mathoms.c | 15 +++++++++++++++ proto.h | 4 ++-- sv.c | 16 ---------------- sv.h | 3 ++- 6 files changed, 20 insertions(+), 22 deletions(-) diff --git a/embed.fnc b/embed.fnc index c4c8587..fbc98f1 100644 --- a/embed.fnc +++ b/embed.fnc @@ -941,7 +941,7 @@ Amdb |STRLEN |sv_utf8_upgrade|NN SV *sv ApdM |bool |sv_utf8_downgrade|NN SV *sv|bool fail_ok Apd |void |sv_utf8_encode |NN SV *sv ApdM |bool |sv_utf8_decode |NN SV *sv -Apd |void |sv_force_normal|NN SV *sv +Apdmb |void |sv_force_normal|NN SV *sv Apd |void |sv_force_normal_flags|NN SV *sv|U32 flags Ap |void |tmps_grow |I32 n Apd |SV* |sv_rvweaken |NN SV *sv diff --git a/embed.h b/embed.h index f99bc5b..744d1c1 100644 --- a/embed.h +++ b/embed.h @@ -973,7 +973,6 @@ #define sv_utf8_downgrade Perl_sv_utf8_downgrade #define sv_utf8_encode Perl_sv_utf8_encode #define sv_utf8_decode Perl_sv_utf8_decode -#define sv_force_normal Perl_sv_force_normal #define sv_force_normal_flags Perl_sv_force_normal_flags #define tmps_grow Perl_tmps_grow #define sv_rvweaken Perl_sv_rvweaken @@ -2960,7 +2959,6 @@ #define sv_utf8_downgrade(a,b) Perl_sv_utf8_downgrade(aTHX_ a,b) #define sv_utf8_encode(a) Perl_sv_utf8_encode(aTHX_ a) #define sv_utf8_decode(a) Perl_sv_utf8_decode(aTHX_ a) -#define sv_force_normal(a) Perl_sv_force_normal(aTHX_ a) #define sv_force_normal_flags(a,b) Perl_sv_force_normal_flags(aTHX_ a,b) #define tmps_grow(a) Perl_tmps_grow(aTHX_ a) #define sv_rvweaken(a) Perl_sv_rvweaken(aTHX_ a) diff --git a/mathoms.c b/mathoms.c index 04cff18..c70d63d 100644 --- a/mathoms.c +++ b/mathoms.c @@ -96,6 +96,21 @@ Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp) return sv_2pv_flags(sv, lp, SV_GMAGIC); } +/* +=for apidoc sv_force_normal + +Undo various types of fakery on an SV: if the PV is a shared string, make +a private copy; if we're a ref, stop refing; if we're a glob, downgrade to +an xpvmg. See also C. + +=cut +*/ + +void +Perl_sv_force_normal(pTHX_ register SV *sv) +{ + sv_force_normal_flags(sv, 0); +} /* sv_setsv() is now a macro using Perl_sv_setsv_flags(); * this function provided for binary compatibility only diff --git a/proto.h b/proto.h index f5914c9..82d35ef 100644 --- a/proto.h +++ b/proto.h @@ -2630,8 +2630,8 @@ PERL_CALLCONV void Perl_sv_utf8_encode(pTHX_ SV *sv) PERL_CALLCONV bool Perl_sv_utf8_decode(pTHX_ SV *sv) __attribute__nonnull__(pTHX_1); -PERL_CALLCONV void Perl_sv_force_normal(pTHX_ SV *sv) - __attribute__nonnull__(pTHX_1); +/* PERL_CALLCONV void Perl_sv_force_normal(pTHX_ SV *sv) + __attribute__nonnull__(pTHX_1); */ PERL_CALLCONV void Perl_sv_force_normal_flags(pTHX_ SV *sv, U32 flags) __attribute__nonnull__(pTHX_1); diff --git a/sv.c b/sv.c index 9b863ce..e0d9786 100644 --- a/sv.c +++ b/sv.c @@ -4579,22 +4579,6 @@ Perl_sv_force_normal_flags(pTHX_ register SV *sv, U32 flags) } /* -=for apidoc sv_force_normal - -Undo various types of fakery on an SV: if the PV is a shared string, make -a private copy; if we're a ref, stop refing; if we're a glob, downgrade to -an xpvmg. See also C. - -=cut -*/ - -void -Perl_sv_force_normal(pTHX_ register SV *sv) -{ - sv_force_normal_flags(sv, 0); -} - -/* =for apidoc sv_chop Efficient removal of characters from the beginning of the string buffer. diff --git a/sv.h b/sv.h index 8dbbcb2..2dc1d8c 100644 --- a/sv.h +++ b/sv.h @@ -1349,7 +1349,8 @@ Like C but doesn't process magic. #define SV_CONST_RETURN 32 #define SV_MUTABLE_RETURN 64 -#define sv_unref(sv) sv_unref_flags(sv, 0) +#define sv_unref(sv) sv_unref_flags(sv, 0) +#define sv_force_normal(sv) sv_force_normal_flags(sv, 0) /* We are about to replace the SV's current value. So if it's copy on write we need to normalise it. Use the SV_COW_DROP_PV flag hint to say that -- 2.7.4