From: Nicholas Clark Date: Wed, 8 Jun 2005 13:43:23 +0000 (+0000) Subject: n_a no more X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0510663fa1f5ec2b546d095c2c040e4f25909e8a;p=p5sagit%2Fp5-mst-13.2.git n_a no more p4raw-id: //depot/perl@24758 --- diff --git a/perl.c b/perl.c index b4b68dc..2b09a4a 100644 --- a/perl.c +++ b/perl.c @@ -336,11 +336,8 @@ perl_construct(pTHXx) if ((long) PL_mmap_page_size < 0) { if (errno) { SV *error = ERRSV; - char *msg; - STRLEN n_a; (void) SvUPGRADE(error, SVt_PV); - msg = SvPVx(error, n_a); - Perl_croak(aTHX_ "panic: sysconf: %s", msg); + Perl_croak(aTHX_ "panic: sysconf: %s", SvPV_nolen_const(error)); } else Perl_croak(aTHX_ "panic: sysconf: pagesize unknown"); @@ -2381,8 +2378,7 @@ Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) PUTBACK; if (croak_on_error && SvTRUE(ERRSV)) { - STRLEN n_a; - Perl_croak(aTHX_ SvPVx(ERRSV, n_a)); + Perl_croak(aTHX_ SvPVx_nolen_const(ERRSV)); } return sv; diff --git a/pp_ctl.c b/pp_ctl.c index be41b9e..e3fd56c 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1381,7 +1381,6 @@ OP * Perl_die_where(pTHX_ const char *message, STRLEN msglen) { dVAR; - STRLEN n_a; if (PL_in_eval) { I32 cxix; @@ -1396,8 +1395,9 @@ Perl_die_where(pTHX_ const char *message, STRLEN msglen) if (!SvPOK(err)) sv_setpvn(err,"",0); else if (SvCUR(err) >= sizeof(prefix)+msglen-1) { - e = SvPV(err, n_a); - e += n_a - msglen; + STRLEN len; + e = SvPV(err, len); + e += len - msglen; if (*e != *message || strNE(e,message)) e = Nullch; } @@ -1453,7 +1453,7 @@ Perl_die_where(pTHX_ const char *message, STRLEN msglen) PL_curcop = cx->blk_oldcop; if (optype == OP_REQUIRE) { - const char* msg = SvPVx(ERRSV, n_a); + const char* msg = SvPVx_nolen_const(ERRSV); SV *nsv = cx->blk_eval.old_namesv; (void)hv_store(GvHVn(PL_incgv), SvPVX_const(nsv), SvCUR(nsv), &PL_sv_undef, 0); @@ -2252,7 +2252,6 @@ PP(pp_goto) if (PL_op->op_flags & OPf_STACKED) { SV *sv = POPs; - STRLEN n_a; /* This egregious kludge implements goto &subroutine */ if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV) { @@ -2462,7 +2461,7 @@ PP(pp_goto) } } else { - label = SvPV(sv,n_a); + label = SvPV_nolen_const(sv); if (!(do_dump || *label)) DIE(aTHX_ must_have_label); } @@ -2641,8 +2640,7 @@ PP(pp_cswitch) if (PL_multiline) PL_op = PL_op->op_next; /* can't assume anything */ else { - STRLEN n_a; - match = *(SvPVx(GvSV(cCOP->cop_gv), n_a)) & 255; + match = *(SvPVx_nolen_const(GvSV(cCOP->cop_gv))) & 255; match -= cCOP->uop.scop.scop_offset; if (match < 0) match = 0; @@ -2926,7 +2924,6 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) SV **newsp; /* Used by POPBLOCK. */ PERL_CONTEXT *cx = &cxstack[cxstack_ix]; I32 optype = 0; /* Might be reset by POPEVAL. */ - STRLEN n_a; PL_op = saveop; if (PL_eval_root) { @@ -2941,7 +2938,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) lex_end(); LEAVE; if (optype == OP_REQUIRE) { - const char* const msg = SvPVx(ERRSV, n_a); + const char* const msg = SvPVx_nolen_const(ERRSV); const SV * const nsv = cx->blk_eval.old_namesv; (void)hv_store(GvHVn(PL_incgv), SvPVX_const(nsv), SvCUR(nsv), &PL_sv_undef, 0); @@ -2949,7 +2946,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) *msg ? msg : "Unknown error\n"); } else if (startop) { - const char* msg = SvPVx(ERRSV, n_a); + const char* msg = SvPVx_nolen_const(ERRSV); POPBLOCK(cx,PL_curpm); POPEVAL(cx); @@ -2957,7 +2954,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq) (*msg ? msg : "Unknown error\n")); } else { - const char* msg = SvPVx(ERRSV, n_a); + const char* msg = SvPVx_nolen_const(ERRSV); if (!*msg) { sv_setpv(ERRSV, "Compilation error"); } @@ -3241,8 +3238,7 @@ PP(pp_require) || (*name == ':' && name[1] != ':' && strchr(name+2, ':')) #endif ) { - STRLEN n_a; - char *dir = SvPVx(dirsv, n_a); + const char *dir = SvPVx_nolen_const(dirsv); #ifdef MACOS_TRADITIONAL char buf1[256]; char buf2[256]; @@ -3305,8 +3301,7 @@ PP(pp_require) sv_catpv(msg, " (did you run h2ph?)"); sv_catpv(msg, " (@INC contains:"); for (i = 0; i <= AvFILL(ar); i++) { - STRLEN n_a; - const char *dir = SvPVx(*av_fetch(ar, i, TRUE), n_a); + const char *dir = SvPVx_nolen_const(*av_fetch(ar, i, TRUE)); Perl_sv_setpvf(aTHX_ dirmsgsv, " %s", dir); sv_catsv(msg, dirmsgsv); } diff --git a/pp_sys.c b/pp_sys.c index 83ac580..7579de8 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2799,7 +2799,6 @@ PP(pp_stat) GV *gv; I32 gimme; I32 max = 13; - STRLEN n_a; if (PL_op->op_flags & OPf_REF) { gv = cGVOP_gv; @@ -2839,15 +2838,15 @@ PP(pp_stat) "lstat() on filehandle %s", GvENAME(gv)); goto do_fstat; } - sv_setpv(PL_statname, SvPV_const(sv,n_a)); + sv_setpv(PL_statname, SvPV_nolen_const(sv)); PL_statgv = Nullgv; PL_laststype = PL_op->op_type; if (PL_op->op_type == OP_LSTAT) - PL_laststatval = PerlLIO_lstat(SvPV(PL_statname, n_a), &PL_statcache); + PL_laststatval = PerlLIO_lstat(SvPV_nolen_const(PL_statname), &PL_statcache); else - PL_laststatval = PerlLIO_stat(SvPV(PL_statname, n_a), &PL_statcache); + PL_laststatval = PerlLIO_stat(SvPV_nolen_const(PL_statname), &PL_statcache); if (PL_laststatval < 0) { - if (ckWARN(WARN_NEWLINE) && strchr(SvPV(PL_statname, n_a), '\n')) + if (ckWARN(WARN_NEWLINE) && strchr(SvPV_nolen_const(PL_statname), '\n')) Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "stat"); max = 0; } diff --git a/universal.c b/universal.c index eb4f531..8f706cb 100644 --- a/universal.c +++ b/universal.c @@ -254,7 +254,6 @@ XS(XS_UNIVERSAL_isa) dXSARGS; SV *sv; const char *name; - STRLEN n_a; if (items != 2) Perl_croak(aTHX_ "Usage: UNIVERSAL::isa(reference, kind)"); @@ -268,7 +267,7 @@ XS(XS_UNIVERSAL_isa) || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv)))) XSRETURN_UNDEF; - name = SvPV_const(ST(1),n_a); + name = SvPV_nolen_const(ST(1)); ST(0) = boolSV(sv_derived_from(sv, name)); XSRETURN(1); @@ -281,7 +280,6 @@ XS(XS_UNIVERSAL_can) const char *name; SV *rv; HV *pkg = NULL; - STRLEN n_a; if (items != 2) Perl_croak(aTHX_ "Usage: UNIVERSAL::can(object-ref, method)"); @@ -295,7 +293,7 @@ XS(XS_UNIVERSAL_can) || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv)))) XSRETURN_UNDEF; - name = SvPV_const(ST(1),n_a); + name = SvPV_nolen_const(ST(1)); rv = &PL_sv_undef; if (SvROK(sv)) { @@ -361,10 +359,9 @@ XS(XS_UNIVERSAL_VERSION) "%s does not define $%s::VERSION--version check failed", name, name); } else { - STRLEN n_a; Perl_croak(aTHX_ "%s defines neither package nor VERSION--version check failed", - SvPVx(ST(0),n_a) ); + SvPVx_nolen_const(ST(0)) ); } }