X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.c;h=19cb7b34e5cb14c88dd1b2ad87670af47be67b19;hb=ca563b4e7524b82fcbffcbe3344a4a9d20a7ab64;hp=94f4b3241620292637ae5274de7ab69ed9974b28;hpb=b347df820803cfaa55e1ef645ee3797402b58e10;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.c b/sv.c index 94f4b32..19cb7b3 100644 --- a/sv.c +++ b/sv.c @@ -3138,7 +3138,7 @@ Perl_sv_2pv_flags(pTHX_ register SV *sv, STRLEN *lp, I32 flags) } tsv = NEWSV(0,0); if (SvOBJECT(sv)) { - const char *name = HvNAME_get(SvSTASH(sv)); + const char * const name = HvNAME_get(SvSTASH(sv)); Perl_sv_setpvf(aTHX_ tsv, "%s=%s(0x%"UVxf")", name ? name : "__ANON__" , typestr, PTR2UV(sv)); } @@ -3444,7 +3444,7 @@ Perl_sv_utf8_upgrade_flags(pTHX_ register SV *sv, I32 flags) * chars in the PV. Given that there isn't such a flag * make the loop as fast as possible. */ const U8 *s = (U8 *) SvPVX_const(sv); - const U8 *e = (U8 *) SvEND(sv); + const U8 * const e = (U8 *) SvEND(sv); const U8 *t = s; int hibit = 0; @@ -3760,11 +3760,6 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) GvNAMELEN(dstr) = len; SvFAKE_on(dstr); /* can coerce to non-glob */ } - /* ahem, death to those who redefine active sort subs */ - else if (PL_curstackinfo->si_type == PERLSI_SORT - && GvCV(dstr) && PL_sortcop == CvSTART(GvCV(dstr))) - Perl_croak(aTHX_ "Can't redefine active sort subroutine %s", - GvNAME(dstr)); #ifdef GV_UNIQUE_CHECK if (GvUNIQUE((GV*)dstr)) { @@ -3867,13 +3862,6 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) if (!GvCVGEN((GV*)dstr) && (CvROOT(cv) || CvXSUB(cv))) { - /* ahem, death to those who redefine - * active sort subs */ - if (PL_curstackinfo->si_type == PERLSI_SORT && - PL_sortcop == CvSTART(cv)) - Perl_croak(aTHX_ - "Can't redefine active sort subroutine %s", - GvENAME((GV*)dstr)); /* Redefining a sub - warning is mandatory if it was a const and its value changed. */ if (ckWARN(WARN_REDEFINE) @@ -7417,19 +7405,15 @@ Perl_sv_reset(pTHX_ register const char *s, HV *stash) av_clear(GvAV(gv)); } if (GvHV(gv) && !HvNAME_get(GvHV(gv))) { +#if defined(VMS) + Perl_die(aTHX_ "Can't reset %%ENV on this system"); +#else /* ! VMS */ hv_clear(GvHV(gv)); -#ifndef PERL_MICRO -#ifdef USE_ENVIRON_ARRAY - if (gv == PL_envgv -# ifdef USE_ITHREADS - && PL_curinterp == aTHX -# endif - ) - { - environ[0] = Nullch; - } -#endif -#endif /* !PERL_MICRO */ +# if defined(USE_ENVIRON_ARRAY) + if (gv == PL_envgv) + my_clearenv(); +# endif /* USE_ENVIRON_ARRAY */ +#endif /* VMS */ } } } @@ -8135,11 +8119,7 @@ Like C, but also handles 'set' magic. void Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv) { - char buf[TYPE_CHARS(UV)]; - char *ebuf; - char * const ptr = uiv_2buf(buf, iv, 0, 0, &ebuf); - - sv_setpvn(sv, ptr, ebuf - ptr); + sv_setpviv(sv, iv); SvSETMAGIC(sv); } @@ -9349,7 +9329,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV && (PL_op->op_type == OP_PRTF || PL_op->op_type == OP_SPRINTF) && ckWARN(WARN_PRINTF)) { - SV *msg = sv_newmortal(); + SV * const msg = sv_newmortal(); Perl_sv_setpvf(aTHX_ msg, "Invalid conversion in %sprintf: ", (PL_op->op_type == OP_PRTF) ? "" : "s"); if (c) { @@ -11529,7 +11509,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_sortstash = hv_dup(proto_perl->Tsortstash, param); PL_firstgv = gv_dup(proto_perl->Tfirstgv, param); PL_secondgv = gv_dup(proto_perl->Tsecondgv, param); - PL_sortcxix = proto_perl->Tsortcxix; PL_efloatbuf = Nullch; /* reinits on demand */ PL_efloatsize = 0; /* reinits on demand */