From: Nicholas Clark Date: Thu, 17 Nov 2005 13:51:01 +0000 (+0000) Subject: s/SvTYPE(sv)/old_type/ in sv_upgrade because we already have that value X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bfc44f79c8382df2655da380f044c9068132d2ec;p=p5sagit%2Fp5-mst-13.2.git s/SvTYPE(sv)/old_type/ in sv_upgrade because we already have that value in that variable. Don't compile S_new_body with -DPURIFY p4raw-id: //depot/perl@26146 --- diff --git a/sv.c b/sv.c index f01695b..e611ba3 100644 --- a/sv.c +++ b/sv.c @@ -1161,6 +1161,11 @@ S_more_bodies (pTHX_ size_t size, svtype sv_type) /* now use the inline version in the proper function */ +#ifndef PURIFY + +/* This isn't being used with -DPURIFY, so don't declare it. Otherwise + compilers issue warnings. */ + STATIC void * S_new_body(pTHX_ size_t size, svtype sv_type) { @@ -1169,6 +1174,8 @@ S_new_body(pTHX_ size_t size, svtype sv_type) return xpv; } +#endif + /* return a thing to the free list */ #define del_body(thing, root) \ @@ -1397,12 +1404,12 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) sv_force_normal_flags(sv, 0); } - if (SvTYPE(sv) == mt) + if (old_type == mt) return; - if (SvTYPE(sv) > mt) + if (old_type > mt) Perl_croak(aTHX_ "sv_upgrade from type %d down to type %d", - (int)SvTYPE(sv), (int)mt); + (int)old_type, (int)mt); old_body = SvANY(sv); @@ -1448,7 +1455,7 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) So we are careful and work out the size of used parts of all the structures. */ - switch (SvTYPE(sv)) { + switch (old_type) { case SVt_NULL: break; case SVt_IV: