From 504618e92cbf415cc727244b0e64aab9ddfb1c10 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Sat, 21 May 2005 04:06:40 -0500 Subject: embed.fnc cleanup + SvPVX_const usage Message-ID: <20050521140640.GB875@petdance.com> p4raw-id: //depot/perl@24561 --- pad.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pad.c') diff --git a/pad.c b/pad.c index 2cff24dc95..c4058133cd 100644 --- a/pad.c +++ b/pad.c @@ -255,7 +255,7 @@ Perl_pad_undef(pTHX_ CV* cv) AV *comppad = (AV*)AvARRAY(padlist)[1]; SV **curpad = AvARRAY(comppad); for (ix = AvFILLp(comppad_name); ix > 0; ix--) { - SV *namesv = namepad[ix]; + SV * const namesv = namepad[ix]; if (namesv && namesv != &PL_sv_undef && *SvPVX_const(namesv) == '&') { @@ -329,7 +329,7 @@ If fake, it means we're cloning an existing entry PADOFFSET Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool fake) { - PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY); + const PADOFFSET offset = pad_alloc(OP_PADSV, SVs_PADMY); SV* namesv = NEWSV(1102, 0); ASSERT_CURPAD_ACTIVE("pad_add_name"); @@ -1123,7 +1123,6 @@ void Perl_pad_tidy(pTHX_ padtidy_type type) { dVAR; - PADOFFSET ix; ASSERT_CURPAD_ACTIVE("pad_tidy"); @@ -1155,6 +1154,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type) if (type == padtidy_SUBCLONE) { SV **namep = AvARRAY(PL_comppad_name); + PADOFFSET ix; for (ix = AvFILLp(PL_comppad); ix > 0; ix--) { SV *namesv; @@ -1186,6 +1186,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type) /* XXX DAPM rationalise these two similar branches */ if (type == padtidy_SUB) { + PADOFFSET ix; for (ix = AvFILLp(PL_comppad); ix > 0; ix--) { if (SvIMMORTAL(PL_curpad[ix]) || IS_PADGV(PL_curpad[ix]) || IS_PADCONST(PL_curpad[ix])) continue; @@ -1194,6 +1195,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type) } } else if (type == padtidy_FORMAT) { + PADOFFSET ix; for (ix = AvFILLp(PL_comppad); ix > 0; ix--) { if (!SvPADMY(PL_curpad[ix]) && !SvIMMORTAL(PL_curpad[ix])) SvPADTMP_on(PL_curpad[ix]); -- cgit v1.2.1