From 9d8f40c4d2ff3c9a7ded072d81df73638a8c1d83 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 26 Nov 2008 21:18:58 +0000 Subject: [PATCH] Merge S_is_gv_magical() into Perl_is_gv_magical_sv(). p4raw-id: //depot/perl@34931 --- embed.fnc | 5 +---- embed.h | 10 ---------- gv.c | 29 ++++++----------------------- pod/perlintern.pod | 14 ++------------ proto.h | 12 ++---------- 5 files changed, 11 insertions(+), 59 deletions(-) diff --git a/embed.fnc b/embed.fnc index 848da46..8495b71 100644 --- a/embed.fnc +++ b/embed.fnc @@ -385,9 +385,6 @@ pd |U32 |intro_my ApPR |char* |instr |NN const char* big|NN const char* little p |bool |io_close |NN IO* io|bool not_implicit pR |OP* |invert |NULLOK OP* cmd -#if defined(PERL_IN_GV_C) -sdR |bool |is_gv_magical |NN const char *name|STRLEN len|U32 flags -#endif ApR |I32 |is_lvalue_sub ApPR |U32 |to_uni_upper_lc|U32 c ApPR |U32 |to_uni_title_lc|U32 c @@ -1904,7 +1901,7 @@ np |void |my_swabn |NN void* ptr|int n Ap |GV* |gv_fetchpvn_flags|NN const char* name|STRLEN len|I32 flags|const svtype sv_type Ap |GV* |gv_fetchsv|NN SV *name|I32 flags|const svtype sv_type -dpR |bool |is_gv_magical_sv|NN SV *name|U32 flags +dpR |bool |is_gv_magical_sv|NN SV *const name_sv|U32 flags ApR |bool |stashpv_hvname_match|NN const COP *c|NN const HV *hv diff --git a/embed.h b/embed.h index 81256a7..9b3c4d7 100644 --- a/embed.h +++ b/embed.h @@ -334,11 +334,6 @@ #define io_close Perl_io_close #define invert Perl_invert #endif -#if defined(PERL_IN_GV_C) -#ifdef PERL_CORE -#define is_gv_magical S_is_gv_magical -#endif -#endif #define is_lvalue_sub Perl_is_lvalue_sub #define to_uni_upper_lc Perl_to_uni_upper_lc #define to_uni_title_lc Perl_to_uni_title_lc @@ -2681,11 +2676,6 @@ #define io_close(a,b) Perl_io_close(aTHX_ a,b) #define invert(a) Perl_invert(aTHX_ a) #endif -#if defined(PERL_IN_GV_C) -#ifdef PERL_CORE -#define is_gv_magical(a,b,c) S_is_gv_magical(aTHX_ a,b,c) -#endif -#endif #define is_lvalue_sub() Perl_is_lvalue_sub(aTHX) #define to_uni_upper_lc(a) Perl_to_uni_upper_lc(aTHX_ a) #define to_uni_title_lc(a) Perl_to_uni_title_lc(aTHX_ a) diff --git a/gv.c b/gv.c index 598eb9e..74a9b2e 100644 --- a/gv.c +++ b/gv.c @@ -2210,25 +2210,6 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags) /* =for apidoc is_gv_magical_sv -Returns C if given the name of a magical GV. Calls is_gv_magical. - -=cut -*/ - -bool -Perl_is_gv_magical_sv(pTHX_ SV *name, U32 flags) -{ - STRLEN len; - const char * const temp = SvPV_const(name, len); - - PERL_ARGS_ASSERT_IS_GV_MAGICAL_SV; - - return is_gv_magical(temp, len, flags); -} - -/* -=for apidoc is_gv_magical - Returns C if given the name of a magical GV. Currently only useful internally when determining if a GV should be @@ -2243,13 +2224,15 @@ pointers returned by SvPV. =cut */ + bool -S_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags) +Perl_is_gv_magical_sv(pTHX_ SV *const name_sv, U32 flags) { - PERL_UNUSED_CONTEXT; - PERL_UNUSED_ARG(flags); + STRLEN len; + const char *const name = SvPV_const(name_sv, len); - PERL_ARGS_ASSERT_IS_GV_MAGICAL; + PERL_UNUSED_ARG(flags); + PERL_ARGS_ASSERT_IS_GV_MAGICAL_SV; if (len > 1) { const char * const name1 = name + 1; diff --git a/pod/perlintern.pod b/pod/perlintern.pod index 40709f8..e15741f 100644 --- a/pod/perlintern.pod +++ b/pod/perlintern.pod @@ -334,8 +334,8 @@ Found in file pad.h =over 8 -=item is_gv_magical -X +=item is_gv_magical_sv +X Returns C if given the name of a magical GV. @@ -349,16 +349,6 @@ Currently assumes that C is NUL terminated (as well as len being valid). This assumption is met by all callers within the perl core, which all pass pointers returned by SvPV. - bool is_gv_magical(const char *name, STRLEN len, U32 flags) - -=for hackers -Found in file gv.c - -=item is_gv_magical_sv -X - -Returns C if given the name of a magical GV. Calls is_gv_magical. - bool is_gv_magical_sv(SV *name, U32 flags) =for hackers diff --git a/proto.h b/proto.h index 14dc4f1..0e43560 100644 --- a/proto.h +++ b/proto.h @@ -1150,14 +1150,6 @@ PERL_CALLCONV bool Perl_io_close(pTHX_ IO* io, bool not_implicit) PERL_CALLCONV OP* Perl_invert(pTHX_ OP* cmd) __attribute__warn_unused_result__; -#if defined(PERL_IN_GV_C) -STATIC bool S_is_gv_magical(pTHX_ const char *name, STRLEN len, U32 flags) - __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_IS_GV_MAGICAL \ - assert(name) - -#endif PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX) __attribute__warn_unused_result__; @@ -6320,11 +6312,11 @@ PERL_CALLCONV GV* Perl_gv_fetchsv(pTHX_ SV *name, I32 flags, const svtype sv_typ #define PERL_ARGS_ASSERT_GV_FETCHSV \ assert(name) -PERL_CALLCONV bool Perl_is_gv_magical_sv(pTHX_ SV *name, U32 flags) +PERL_CALLCONV bool Perl_is_gv_magical_sv(pTHX_ SV *const name_sv, U32 flags) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_GV_MAGICAL_SV \ - assert(name) + assert(name_sv) PERL_CALLCONV bool Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV *hv) -- 2.7.4