diff options
author | Andy Lester <andy@petdance.com> | 2005-06-20 05:22:37 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-06-20 15:12:50 +0000 |
commit | 53c1dcc098c6cc47963786f1928061d90b5d30e1 (patch) | |
tree | 018888fffdf323f44128fe1434e39e7b5cccceae /gv.c | |
parent | 7e3ec654269fdea39968d4cec52cbfcb1f030631 (diff) | |
download | perl-53c1dcc098c6cc47963786f1928061d90b5d30e1.tar.gz |
The continuing adventures of Constman and Localize Boy
Message-ID: <20050620152237.GA5032@petdance.com>
p4raw-id: //depot/perl@24913
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -1327,13 +1327,13 @@ Perl_gp_free(pTHX_ GV *gv) int Perl_magic_freeovrld(pTHX_ SV *sv, MAGIC *mg) { - AMT *amtp = (AMT*)mg->mg_ptr; - (void)sv; + AMT * const amtp = (AMT*)mg->mg_ptr; + PERL_UNUSED_ARG(sv); if (amtp && AMT_AMAGIC(amtp)) { int i; for (i = 1; i < NofAMmeth; i++) { - CV *cv = amtp->table[i]; + CV * const cv = amtp->table[i]; if (cv != Nullcv) { SvREFCNT_dec((SV *) cv); amtp->table[i] = Nullcv; @@ -1348,10 +1348,8 @@ Perl_magic_freeovrld(pTHX_ SV *sv, MAGIC *mg) bool Perl_Gv_AMupdate(pTHX_ HV *stash) { - GV* gv; - CV* cv; - MAGIC* mg=mg_find((SV*)stash, PERL_MAGIC_overload_table); - AMT *amtp = (mg) ? (AMT*)mg->mg_ptr: (AMT *) NULL; + MAGIC* const mg = mg_find((SV*)stash, PERL_MAGIC_overload_table); + AMT * const amtp = (mg) ? (AMT*)mg->mg_ptr: (AMT *) NULL; AMT amt; if (mg && amtp->was_ok_am == PL_amagic_generation @@ -1370,14 +1368,13 @@ Perl_Gv_AMupdate(pTHX_ HV *stash) { int filled = 0, have_ovl = 0; int i, lim = 1; - SV* sv = NULL; /* Work with "fallback" key, which we assume to be first in PL_AMG_names */ /* Try to find via inheritance. */ - gv = gv_fetchmeth(stash, PL_AMG_names[0], 2, -1); - if (gv) - sv = GvSV(gv); + GV *gv = gv_fetchmeth(stash, PL_AMG_names[0], 2, -1); + SV * const sv = gv ? GvSV(gv) : NULL; + CV* cv; if (!gv) lim = DESTROY_amg; /* Skip overloading entries. */ |