From: Nicholas Clark Date: Wed, 3 Jan 2007 23:13:43 +0000 (+0000) Subject: Rename OURSTASH to SvOURSTASH and OURSTASH_set to SvOURSTASH_set. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=73d95100627fbb8760df38c23d7563a42cc2b6f6;p=p5sagit%2Fp5-mst-13.2.git Rename OURSTASH to SvOURSTASH and OURSTASH_set to SvOURSTASH_set. p4raw-id: //depot/perl@29679 --- diff --git a/dump.c b/dump.c index 448db91..07fd8b5 100644 --- a/dump.c +++ b/dump.c @@ -1553,8 +1553,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo } if (type >= SVt_PVMG) { if (type == SVt_PVMG && SvPAD_OUR(sv)) { - if (OURSTASH(sv)) - do_hv_dump(level, file, " OURSTASH", OURSTASH(sv)); + if (SvOURSTASH(sv)) + do_hv_dump(level, file, " OURSTASH", SvOURSTASH(sv)); } else { if (SvMAGIC(sv)) do_magic_dump(level, file, SvMAGIC(sv), nest, maxnest, dumpops, pvlim); diff --git a/pad.c b/pad.c index 37b056c..c4b8e5e 100644 --- a/pad.c +++ b/pad.c @@ -75,7 +75,7 @@ The SVs in the names AV have their PV being the name of the variable. xlow+1..xhigh inclusive in the NV union is a range of cop_seq numbers for which the name is valid. For typed lexicals name SV is SVt_PVMG and SvSTASH points at the type. For C lexicals, the type is also SVt_PVMG, with the -OURSTASH slot pointing at the stash of the associated global (so that +SvOURSTASH slot pointing at the stash of the associated global (so that duplicate C declarations in the same package can be detected). SvUVX is sometimes hijacked to store the generation number during compilation. @@ -335,7 +335,7 @@ offset. If C is valid, the name is for a typed lexical; set the name's stash to that value. If C is valid, it's an our lexical, set the name's -OURSTASH to that value +SvOURSTASH to that value If fake, it means we're cloning an existing entry @@ -362,7 +362,7 @@ Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool fake } if (ourstash) { SvPAD_OUR_on(namesv); - OURSTASH_set(namesv, ourstash); + SvOURSTASH_set(namesv, ourstash); SvREFCNT_inc_simple_void_NN(ourstash); } else if (state) { @@ -567,7 +567,7 @@ Perl_pad_check_dup(pTHX_ const char *name, bool is_our, const HV *ourstash) && sv != &PL_sv_undef && !SvFAKE(sv) && (COP_SEQ_RANGE_HIGH(sv) == PAD_MAX || COP_SEQ_RANGE_HIGH(sv) == 0) - && OURSTASH(sv) == ourstash + && SvOURSTASH(sv) == ourstash && strEQ(name, SvPVX_const(sv))) { Perl_warner(aTHX_ packWARN(WARN_MISC), @@ -853,7 +853,7 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, SvPVX_const(*out_name_sv), SvPAD_TYPED(*out_name_sv) ? SvSTASH(*out_name_sv) : NULL, - OURSTASH(*out_name_sv), + SvOURSTASH(*out_name_sv), 1, /* fake */ 0 /* not a state variable */ ); diff --git a/pad.h b/pad.h index 81a1312..4f46166 100644 --- a/pad.h +++ b/pad.h @@ -295,7 +295,7 @@ ling pad (lvalue) to C. Note that C is hijacked for this purpose #define PAD_COMPNAME_TYPE(po) pad_compname_type(po) #define PAD_COMPNAME_OURSTASH(po) \ - (OURSTASH(PAD_COMPNAME_SV(po))) + (SvOURSTASH(PAD_COMPNAME_SV(po))) #define PAD_COMPNAME_GEN(po) ((STRLEN)SvUVX(AvARRAY(PL_comppad_name)[po])) diff --git a/sv.c b/sv.c index 15f54d8..fc9914f 100644 --- a/sv.c +++ b/sv.c @@ -5120,7 +5120,7 @@ Perl_sv_clear(pTHX_ register SV *sv) } if (type >= SVt_PVMG) { if (type == SVt_PVMG && SvPAD_OUR(sv)) { - SvREFCNT_dec(OURSTASH(sv)); + SvREFCNT_dec(SvOURSTASH(sv)); } else if (SvMAGIC(sv)) mg_free(sv); if (type == SVt_PVMG && SvPAD_TYPED(sv)) @@ -10024,7 +10024,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param) FIXME - instrument and check that assumption */ if (sv_type >= SVt_PVMG) { if ((sv_type == SVt_PVMG) && SvPAD_OUR(dstr)) { - OURSTASH_set(dstr, hv_dup_inc(OURSTASH(dstr), param)); + SvOURSTASH_set(dstr, hv_dup_inc(SvOURSTASH(dstr), param)); } else if (SvMAGIC(dstr)) SvMAGIC_set(dstr, mg_dup(SvMAGIC(dstr), param)); if (SvSTASH(dstr)) diff --git a/sv.h b/sv.h index f3ac3e8..b2cc8f4 100644 --- a/sv.h +++ b/sv.h @@ -1206,9 +1206,9 @@ the scalar's value cannot change unless written to. # define SvPAD_STATE_on(sv) (SvFLAGS(sv) |= SVpad_NAME|SVpad_STATE) #endif -#define OURSTASH(sv) \ +#define SvOURSTASH(sv) \ (SvPAD_OUR(sv) ? ((XPVMG*) SvANY(sv))->xmg_u.xmg_ourstash : NULL) -#define OURSTASH_set(sv, st) \ +#define SvOURSTASH_set(sv, st) \ STMT_START { \ assert(SvTYPE(sv) == SVt_PVMG); \ ((XPVMG*) SvANY(sv))->xmg_u.xmg_ourstash = st; \