diff options
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 274 |
1 files changed, 137 insertions, 137 deletions
@@ -38,7 +38,7 @@ static int PL_OpSpace = 0; } while (0) STATIC void * -Slab_Alloc(pTHX_ int m, size_t sz) +S_Slab_Alloc(pTHX_ int m, size_t sz) { Newz(m,PL_OpPtr,SLAB_SIZE,char); PL_OpSpace = SLAB_SIZE - sz; @@ -55,14 +55,14 @@ Slab_Alloc(pTHX_ int m, size_t sz) #define CHECKOP(type,o) \ ((PL_op_mask && PL_op_mask[type]) \ ? ( op_free((OP*)o), \ - croak("%s trapped by operation mask", PL_op_desc[type]), \ + Perl_croak(aTHX_ "%s trapped by operation mask", PL_op_desc[type]), \ Nullop ) \ - : (CHECKCALL[type])((OP*)o)) + : (CHECKCALL[type])(aTHX_ (OP*)o)) #define PAD_MAX 999999999 STATIC char* -gv_ename(pTHX_ GV *gv) +S_gv_ename(pTHX_ GV *gv) { STRLEN n_a; SV* tmpsv = sv_newmortal(); @@ -71,38 +71,38 @@ gv_ename(pTHX_ GV *gv) } STATIC OP * -no_fh_allowed(pTHX_ OP *o) +S_no_fh_allowed(pTHX_ OP *o) { - yyerror(form("Missing comma after first argument to %s function", + yyerror(Perl_form(aTHX_ "Missing comma after first argument to %s function", PL_op_desc[o->op_type])); return o; } STATIC OP * -too_few_arguments(pTHX_ OP *o, char *name) +S_too_few_arguments(pTHX_ OP *o, char *name) { - yyerror(form("Not enough arguments for %s", name)); + yyerror(Perl_form(aTHX_ "Not enough arguments for %s", name)); return o; } STATIC OP * -too_many_arguments(pTHX_ OP *o, char *name) +S_too_many_arguments(pTHX_ OP *o, char *name) { - yyerror(form("Too many arguments for %s", name)); + yyerror(Perl_form(aTHX_ "Too many arguments for %s", name)); return o; } STATIC void -bad_type(pTHX_ I32 n, char *t, char *name, OP *kid) +S_bad_type(pTHX_ I32 n, char *t, char *name, OP *kid) { - yyerror(form("Type of arg %d to %s must be %s (not %s)", + yyerror(Perl_form(aTHX_ "Type of arg %d to %s must be %s (not %s)", (int)n, name, t, PL_op_desc[kid->op_type])); } STATIC void -no_bareword_allowed(pTHX_ OP *o) +S_no_bareword_allowed(pTHX_ OP *o) { - warn("Bareword \"%s\" not allowed while \"strict subs\" in use", + Perl_warn(aTHX_ "Bareword \"%s\" not allowed while \"strict subs\" in use", SvPV_nolen(cSVOPo->op_sv)); ++PL_error_count; } @@ -112,14 +112,14 @@ Perl_assertref(pTHX_ OP *o) { int type = o->op_type; if (type != OP_AELEM && type != OP_HELEM && type != OP_GELEM) { - yyerror(form("Can't use subscript on %s", PL_op_desc[type])); + yyerror(Perl_form(aTHX_ "Can't use subscript on %s", PL_op_desc[type])); if (type == OP_ENTERSUB || type == OP_RV2HV || type == OP_PADHV) { dTHR; SV *msg = sv_2mortal( - newSVpvf("(Did you mean $ or @ instead of %c?)\n", + Perl_newSVpvf(aTHX_ "(Did you mean $ or @ instead of %c?)\n", type == OP_ENTERSUB ? '&' : '%')); if (PL_in_eval & EVAL_WARNONLY) - warn("%_", msg); + Perl_warn(aTHX_ "%_", msg); else if (PL_in_eval) sv_catsv(GvSV(PL_errgv), msg); else @@ -161,7 +161,7 @@ Perl_pad_allocmy(pTHX_ char *name) name[2] = toCTRL(name[1]); name[1] = '^'; } - yyerror(form("Can't use global %s in \"my\"",name)); + yyerror(Perl_form(aTHX_ "Can't use global %s in \"my\"",name)); } if (ckWARN(WARN_UNSAFE) && AvFILLp(PL_comppad_name) >= 0) { SV **svp = AvARRAY(PL_comppad_name); @@ -171,7 +171,7 @@ Perl_pad_allocmy(pTHX_ char *name) && (SvIVX(sv) == PAD_MAX || SvIVX(sv) == 0) && strEQ(name, SvPVX(sv))) { - warner(WARN_UNSAFE, + Perl_warner(aTHX_ WARN_UNSAFE, "\"my\" variable %s masks earlier declaration in same %s", name, (SvIVX(sv) == PAD_MAX ? "scope" : "statement")); break; @@ -184,7 +184,7 @@ Perl_pad_allocmy(pTHX_ char *name) sv_setpv(sv, name); if (PL_in_my_stash) { if (*name != '$') - yyerror(form("Can't declare class for non-scalar %s in \"my\"", + yyerror(Perl_form(aTHX_ "Can't declare class for non-scalar %s in \"my\"", name)); SvOBJECT_on(sv); (void)SvUPGRADE(sv, SVt_PVMG); @@ -208,7 +208,7 @@ Perl_pad_allocmy(pTHX_ char *name) #define FINDLEX_NOSEARCH 1 /* don't search outer contexts */ STATIC PADOFFSET -pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv, +S_pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix, I32 saweval, U32 flags) { dTHR; @@ -283,7 +283,7 @@ pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv, if (ckWARN(WARN_CLOSURE) && !CvUNIQUE(bcv) && !CvUNIQUE(cv)) { - warner(WARN_CLOSURE, + Perl_warner(aTHX_ WARN_CLOSURE, "Variable \"%s\" may be unavailable", name); } @@ -294,7 +294,7 @@ pad_findlex(pTHX_ char *name, PADOFFSET newoff, U32 seq, CV* startcv, } else if (!CvUNIQUE(PL_compcv)) { if (ckWARN(WARN_CLOSURE) && !SvFAKE(sv) && !CvUNIQUE(cv)) - warner(WARN_CLOSURE, + Perl_warner(aTHX_ WARN_CLOSURE, "Variable \"%s\" will not stay shared", name); } } @@ -420,7 +420,7 @@ Perl_pad_leavemy(pTHX_ I32 fill) if (PL_min_intro_pending && fill < PL_min_intro_pending) { for (off = PL_max_intro_pending; off >= PL_min_intro_pending; off--) { if ((sv = svp[off]) && sv != &PL_sv_undef) - warn("%s never introduced", SvPVX(sv)); + Perl_warn(aTHX_ "%s never introduced", SvPVX(sv)); } } /* "Deintroduce" my variables that are leaving with this scope. */ @@ -438,7 +438,7 @@ Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype) I32 retval; if (AvARRAY(PL_comppad) != PL_curpad) - croak("panic: pad_alloc"); + Perl_croak(aTHX_ "panic: pad_alloc"); if (PL_pad_reset_pending) pad_reset(); if (tmptype & SVs_PADMY) { @@ -488,7 +488,7 @@ Perl_pad_sv(pTHX_ PADOFFSET po) (unsigned long) thr, (unsigned long) PL_curpad, po)); #else if (!po) - croak("panic: pad_sv po"); + Perl_croak(aTHX_ "panic: pad_sv po"); DEBUG_X(PerlIO_printf(Perl_debug_log, "Pad 0x%lx sv %d\n", (unsigned long) PL_curpad, po)); #endif /* USE_THREADS */ @@ -502,9 +502,9 @@ Perl_pad_free(pTHX_ PADOFFSET po) if (!PL_curpad) return; if (AvARRAY(PL_comppad) != PL_curpad) - croak("panic: pad_free curpad"); + Perl_croak(aTHX_ "panic: pad_free curpad"); if (!po) - croak("panic: pad_free po"); + Perl_croak(aTHX_ "panic: pad_free po"); #ifdef USE_THREADS DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx free %d\n", (unsigned long) thr, (unsigned long) PL_curpad, po)); @@ -523,9 +523,9 @@ Perl_pad_swipe(pTHX_ PADOFFSET po) { dTHR; if (AvARRAY(PL_comppad) != PL_curpad) - croak("panic: pad_swipe curpad"); + Perl_croak(aTHX_ "panic: pad_swipe curpad"); if (!po) - croak("panic: pad_swipe po"); + Perl_croak(aTHX_ "panic: pad_swipe po"); #ifdef USE_THREADS DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx swipe %d\n", (unsigned long) thr, (unsigned long) PL_curpad, po)); @@ -554,7 +554,7 @@ Perl_pad_reset(pTHX) register I32 po; if (AvARRAY(PL_comppad) != PL_curpad) - croak("panic: pad_reset curpad"); + Perl_croak(aTHX_ "panic: pad_reset curpad"); #ifdef USE_THREADS DEBUG_X(PerlIO_printf(Perl_debug_log, "0x%lx Pad 0x%lx reset\n", (unsigned long) thr, (unsigned long) PL_curpad)); @@ -676,7 +676,7 @@ Perl_op_free(pTHX_ OP *o) #endif /* USE_THREADS */ default: if (!(o->op_flags & OPf_REF) - || (PL_check[o->op_type] != FUNC_NAME_TO_PTR(ck_ftst))) + || (PL_check[o->op_type] != FUNC_NAME_TO_PTR(Perl_ck_ftst))) break; /* FALL THROUGH */ case OP_GVSV: @@ -730,7 +730,7 @@ Perl_op_free(pTHX_ OP *o) } STATIC void -null(pTHX_ OP *o) +S_null(pTHX_ OP *o) { if (o->op_type != OP_NULL && o->op_type != OP_THREADSV && o->op_targ > 0) pad_free(o->op_targ); @@ -779,7 +779,7 @@ Perl_scalarkids(pTHX_ OP *o) } STATIC OP * -scalarboolean(pTHX_ OP *o) +S_scalarboolean(pTHX_ OP *o) { if (o->op_type == OP_SASSIGN && cBINOPo->op_first->op_type == OP_CONST) { dTHR; @@ -788,7 +788,7 @@ scalarboolean(pTHX_ OP *o) if (PL_copline != NOLINE) PL_curcop->cop_line = PL_copline; - warner(WARN_SYNTAX, "Found = in conditional, should be =="); + Perl_warner(aTHX_ WARN_SYNTAX, "Found = in conditional, should be =="); PL_curcop->cop_line = oldline; } } @@ -1057,7 +1057,7 @@ Perl_scalarvoid(pTHX_ OP *o) if (useless) { dTHR; if (ckWARN(WARN_VOID)) - warner(WARN_VOID, "Useless use of %s in void context", useless); + Perl_warner(aTHX_ WARN_VOID, "Useless use of %s in void context", useless); } return o; } @@ -1169,7 +1169,7 @@ Perl_scalarseq(pTHX_ OP *o) } STATIC OP * -modkids(pTHX_ OP *o, I32 type) +S_modkids(pTHX_ OP *o, I32 type) { OP *kid; if (o && o->op_flags & OPf_KIDS) { @@ -1208,7 +1208,7 @@ Perl_mod(pTHX_ OP *o, I32 type) else if (type == OP_REFGEN) goto nomod; else - croak("That use of $[ is unsupported"); + Perl_croak(aTHX_ "That use of $[ is unsupported"); break; case OP_STUB: if (o->op_flags & OPf_PARENS) @@ -1229,7 +1229,7 @@ Perl_mod(pTHX_ OP *o, I32 type) /* grep, foreach, subcalls, refgen */ if (type == OP_GREPSTART || type == OP_ENTERSUB || type == OP_REFGEN) break; - yyerror(form("Can't modify %s in %s", + yyerror(Perl_form(aTHX_ "Can't modify %s in %s", (o->op_type == OP_NULL && (o->op_flags & OPf_SPECIAL) ? "do block" : PL_op_desc[o->op_type]), type ? PL_op_desc[type] : "local")); @@ -1268,7 +1268,7 @@ Perl_mod(pTHX_ OP *o, I32 type) case OP_RV2AV: case OP_RV2HV: if (!type && cUNOPo->op_first->op_type != OP_GV) - croak("Can't localize through a reference"); + Perl_croak(aTHX_ "Can't localize through a reference"); if (type == OP_REFGEN && o->op_flags & OPf_PARENS) { PL_modcount = 10000; return o; /* Treat \(@foo) like ordinary list. */ @@ -1290,7 +1290,7 @@ Perl_mod(pTHX_ OP *o, I32 type) break; case OP_RV2SV: if (!type && cUNOPo->op_first->op_type != OP_GV) - croak("Can't localize through a reference"); + Perl_croak(aTHX_ "Can't localize through a reference"); ref(cUNOPo->op_first, o->op_type); /* FALL THROUGH */ case OP_GV: @@ -1314,7 +1314,7 @@ Perl_mod(pTHX_ OP *o, I32 type) case OP_PADSV: PL_modcount++; if (!type) - croak("Can't localize lexical variable %s", + Perl_croak(aTHX_ "Can't localize lexical variable %s", SvPV(*av_fetch(PL_comppad_name, o->op_targ, 4), n_a)); break; @@ -1391,7 +1391,7 @@ Perl_mod(pTHX_ OP *o, I32 type) } STATIC bool -scalar_mod_type(pTHX_ OP *o, I32 type) +S_scalar_mod_type(pTHX_ OP *o, I32 type) { switch (type) { case OP_SASSIGN: @@ -1438,7 +1438,7 @@ scalar_mod_type(pTHX_ OP *o, I32 type) } STATIC bool -is_handle_constructor(pTHX_ OP *o, I32 argnum) +S_is_handle_constructor(pTHX_ OP *o, I32 argnum) { switch (o->op_type) { case OP_PIPE_OP: @@ -1580,7 +1580,7 @@ Perl_my(pTHX_ OP *o) type != OP_PADHV && type != OP_PUSHMARK) { - yyerror(form("Can't declare %s in my", PL_op_desc[o->op_type])); + yyerror(Perl_form(aTHX_ "Can't declare %s in my", PL_op_desc[o->op_type])); return o; } o->op_flags |= OPf_MOD; @@ -1613,7 +1613,7 @@ Perl_bind_match(pTHX_ I32 type, OP *left, OP *right) char *sample = ((left->op_type == OP_RV2AV || left->op_type == OP_PADAV) ? "@array" : "%hash"); - warner(WARN_UNSAFE, + Perl_warner(aTHX_ WARN_UNSAFE, "Applying %s to %s will act on scalar(%s)", desc, sample, sample); } @@ -1732,7 +1732,7 @@ Perl_block_end(pTHX_ I32 floor, OP *seq) } STATIC OP * -newDEFSVOP(pTHX) +S_newDEFSVOP(pTHX) { #ifdef USE_THREADS OP *o = newOP(OP_THREADSV, 0); @@ -1792,7 +1792,7 @@ Perl_localize(pTHX_ OP *o, I32 lex) char *s; for (s = PL_bufptr; *s && (isALNUM(*s) || (*s & 0x80) || strchr("@$%, ",*s)); s++) ; if (*s == ';' || *s == '=') - warner(WARN_PARENTHESIS, "Parentheses missing around \"%s\" list", + Perl_warner(aTHX_ WARN_PARENTHESIS, "Parentheses missing around \"%s\" list", lex ? "my" : "local"); } } @@ -1876,7 +1876,7 @@ Perl_fold_constants(pTHX_ register OP *o) curop = LINKLIST(o); o->op_next = 0; PL_op = curop; - CALLRUNOPS(); + CALLRUNOPS(aTHX); sv = *(PL_stack_sp--); if (o->op_targ && sv == PAD_SV(o->op_targ)) /* grab pad temp? */ pad_swipe(o->op_targ); @@ -1940,10 +1940,10 @@ Perl_gen_constant_list(pTHX_ register OP *o) PL_op = curop = LINKLIST(o); o->op_next = 0; - pp_pushmark(ARGS); - CALLRUNOPS(); + pp_pushmark(); + CALLRUNOPS(aTHX); PL_op = curop; - pp_anonlist(ARGS); + pp_anonlist(); PL_tmps_floor = oldtmps_floor; o->op_type = OP_RV2AV; @@ -2352,15 +2352,15 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) if (rfirst == 0xffffffff) { diff = tdiff; /* oops, pretend rdiff is infinite */ if (diff > 0) - sv_catpvf(listsv, "%04x\t%04x\tXXXX\n", tfirst, tlast); + Perl_sv_catpvf(aTHX_ listsv, "%04x\t%04x\tXXXX\n", tfirst, tlast); else - sv_catpvf(listsv, "%04x\t\tXXXX\n", tfirst); + Perl_sv_catpvf(aTHX_ listsv, "%04x\t\tXXXX\n", tfirst); } else { if (diff > 0) - sv_catpvf(listsv, "%04x\t%04x\t%04x\n", tfirst, tfirst + diff, rfirst); + Perl_sv_catpvf(aTHX_ listsv, "%04x\t%04x\t%04x\n", tfirst, tfirst + diff, rfirst); else - sv_catpvf(listsv, "%04x\t\t%04x\n", tfirst, rfirst); + Perl_sv_catpvf(aTHX_ listsv, "%04x\t\t%04x\n", tfirst, rfirst); if (rfirst + diff > max) max = rfirst + diff; @@ -2507,7 +2507,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl) p = SvPV(pat, plen); pm->op_pmflags |= PMf_SKIPWHITE; } - pm->op_pmregexp = CALLREGCOMP(p, p + plen, pm); + pm->op_pmregexp = CALLREGCOMP(aTHX_ p, p + plen, pm); if (strEQ("\\s+", pm->op_pmregexp->precomp)) pm->op_pmflags |= PMf_WHITE; op_free(expr); @@ -2723,7 +2723,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *id, OP *arg) GV *gv; if (id->op_type != OP_CONST) - croak("Module name must be constant"); + Perl_croak(aTHX_ "Module name must be constant"); veop = Nullop; @@ -2738,7 +2738,7 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *id, OP *arg) OP *meth; if (version->op_type != OP_CONST || !SvNIOK(vesv)) - croak("Version number must be constant number"); + Perl_croak(aTHX_ "Version number must be constant number"); /* Make copy of id so we don't free it twice */ pack = newSVOP(OP_CONST, 0, newSVsv(((SVOP*)id)->op_sv)); @@ -2834,7 +2834,7 @@ Perl_newSLICEOP(pTHX_ I32 flags, OP *subscript, OP *listval) } STATIC I32 -list_assignment(pTHX_ register OP *o) +S_list_assignment(pTHX_ register OP *o) { if (!o) return TRUE; @@ -3092,7 +3092,7 @@ Perl_newLOGOP(pTHX_ I32 type, I32 flags, OP *first, OP *other) } STATIC OP * -new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) +S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) { dTHR; LOGOP *logop; @@ -3121,7 +3121,7 @@ new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) } if (first->op_type == OP_CONST) { if (ckWARN(WARN_PRECEDENCE) && (first->op_private & OPpCONST_BARE)) - warner(WARN_PRECEDENCE, "Probable precedence problem on %s", + Perl_warner(aTHX_ WARN_PRECEDENCE, "Probable precedence problem on %s", PL_op_desc[type]); if ((type == OP_AND) == (SvTRUE(((SVOP*)first)->op_sv))) { op_free(first); @@ -3163,7 +3163,7 @@ new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp) if (warnop) { line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = PL_copline; - warner(WARN_UNSAFE, + Perl_warner(aTHX_ WARN_UNSAFE, "Value of %s%s can be \"0\"; test with defined()", PL_op_desc[warnop], ((warnop == OP_READLINE || warnop == OP_GLOB) @@ -3469,7 +3469,7 @@ Perl_newFOROP(pTHX_ I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *blo sv = Nullop; } else - croak("Can't use %s for loop variable", PL_op_desc[sv->op_type]); + Perl_croak(aTHX_ "Can't use %s for loop variable", PL_op_desc[sv->op_type]); } else { #ifdef USE_THREADS @@ -3574,10 +3574,10 @@ Perl_cv_undef(pTHX_ CV *cv) if (!CvXSUB(cv) && CvROOT(cv)) { #ifdef USE_THREADS if (CvDEPTH(cv) || (CvOWNER(cv) && CvOWNER(cv) != thr)) - croak("Can't undef active subroutine"); + Perl_croak(aTHX_ "Can't undef active subroutine"); #else if (CvDEPTH(cv)) - croak("Can't undef active subroutine"); + Perl_croak(aTHX_ "Can't undef active subroutine"); #endif /* USE_THREADS */ ENTER; @@ -3664,7 +3664,7 @@ cv_dump(CV *cv) #endif /* DEBUG_CLOSURES */ STATIC CV * -cv_clone2(pTHX_ CV *proto, CV *outside) +S_cv_clone2(pTHX_ CV *proto, CV *outside) { dTHR; AV* av; @@ -3738,7 +3738,7 @@ cv_clone2(pTHX_ CV *proto, CV *outside) if (!off) PL_curpad[ix] = SvREFCNT_inc(ppad[ix]); else if (off != ix) - croak("panic: cv_clone: %s", name); + Perl_croak(aTHX_ "panic: cv_clone: %s", name); } else { /* our own lexical */ SV* sv; @@ -3816,15 +3816,15 @@ Perl_cv_ckproto(pTHX_ CV *cv, GV *gv, char *p) gv_efullname3(name = sv_newmortal(), gv, Nullch); sv_setpv(msg, "Prototype mismatch:"); if (name) - sv_catpvf(msg, " sub %_", name); + Perl_sv_catpvf(aTHX_ msg, " sub %_", name); if (SvPOK(cv)) - sv_catpvf(msg, " (%s)", SvPVX(cv)); + Perl_sv_catpvf(aTHX_ msg, " (%s)", SvPVX(cv)); sv_catpv(msg, " vs "); if (p) - sv_catpvf(msg, "(%s)", p); + Perl_sv_catpvf(aTHX_ msg, "(%s)", p); else sv_catpv(msg, "none"); - warn("%_", msg); + Perl_warn(aTHX_ "%_", msg); } } @@ -3895,7 +3895,7 @@ Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block) maximum a prototype before. */ if (SvTYPE(gv) > SVt_NULL) { if (!SvPOK((SV*)gv) && !(SvIOK((SV*)gv) && SvIVX((SV*)gv) == -1)) - warn("Runaway prototype"); + Perl_warn(aTHX_ "Runaway prototype"); cv_ckproto((CV*)gv, NULL, ps); } if (ps) @@ -3923,7 +3923,7 @@ Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block) } /* ahem, death to those who redefine active sort subs */ if (PL_curstackinfo->si_type == PERLSI_SORT && PL_sortcop == CvSTART(cv)) - croak("Can't redefine active sort subroutine %s", name); + Perl_croak(aTHX_ "Can't redefine active sort subroutine %s", name); if(const_sv = cv_const_sv(cv)) const_changed = sv_cmp(const_sv, op_const_sv(block, Nullcv)); if ((const_sv && const_changed) || ckWARN(WARN_REDEFINE) @@ -3933,7 +3933,7 @@ Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block) "autouse"))) { line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = PL_copline; - warner(WARN_REDEFINE, + Perl_warner(aTHX_ WARN_REDEFINE, const_sv ? "Constant subroutine %s redefined" : "Subroutine %s redefined", name); PL_curcop->cop_line = oldline; @@ -3985,11 +3985,11 @@ Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block) char *not_safe = "BEGIN not safe after errors--compilation aborted"; if (PL_in_eval & EVAL_KEEPERR) - croak(not_safe); + Perl_croak(aTHX_ not_safe); else { /* force display of errors found but not reported */ sv_catpv(ERRSV, not_safe); - croak("%s", SvPVx(ERRSV, n_a)); + Perl_croak(aTHX_ "%s", SvPVx(ERRSV, n_a)); } } } @@ -4055,7 +4055,7 @@ Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block) CV *cv; HV *hv; - sv_setpvf(sv, "%_:%ld-%ld", + Perl_sv_setpvf(aTHX_ sv, "%_:%ld-%ld", GvSV(PL_curcop->cop_filegv), (long)PL_subline, (long)PL_curcop->cop_line); gv_efullname3(tmpstr, gv, Nullch); @@ -4164,7 +4164,7 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename) line_t oldline = PL_curcop->cop_line; if (PL_copline != NOLINE) PL_curcop->cop_line = PL_copline; - warner(WARN_REDEFINE, "Subroutine %s redefined",name); + Perl_warner(aTHX_ WARN_REDEFINE, "Subroutine %s redefined",name); PL_curcop->cop_line = oldline; } SvREFCNT_dec(cv); @@ -4245,7 +4245,7 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = PL_copline; - warner(WARN_REDEFINE, "Format %s redefined",name); + Perl_warner(aTHX_ WARN_REDEFINE, "Format %s redefined",name); PL_curcop->cop_line = oldline; } SvREFCNT_dec(cv); @@ -4306,7 +4306,7 @@ Perl_oopsAV(pTHX_ OP *o) break; default: - warn("oops: oopsAV"); + Perl_warn(aTHX_ "oops: oopsAV"); break; } return o; @@ -4330,7 +4330,7 @@ Perl_oopsHV(pTHX_ OP *o) break; default: - warn("oops: oopsHV"); + Perl_warn(aTHX_ "oops: oopsHV"); break; } return o; @@ -4369,7 +4369,7 @@ Perl_newHVREF(pTHX_ OP *o) OP * Perl_oopsCV(pTHX_ OP *o) { - croak("NOT IMPL LINE %d",__LINE__); + Perl_croak(aTHX_ "NOT IMPL LINE %d",__LINE__); /* STUB */ return o; } @@ -4398,7 +4398,7 @@ Perl_newSVREF(pTHX_ OP *o) /* Check routines. */ OP * -ck_anoncode(OP *o) +Perl_ck_anoncode(pTHX_ OP *o) { PADOFFSET ix; SV* name; @@ -4418,14 +4418,14 @@ ck_anoncode(OP *o) } OP * -ck_bitop(OP *o) +Perl_ck_bitop(pTHX_ OP *o) { o->op_private = PL_hints; return o; } OP * -ck_concat(OP *o) +Perl_ck_concat(pTHX_ OP *o) { if (cUNOPo->op_first->op_type == OP_CONCAT) o->op_flags |= OPf_STACKED; @@ -4433,7 +4433,7 @@ ck_concat(OP *o) } OP * -ck_spair(OP *o) +Perl_ck_spair(pTHX_ OP *o) { if (o->op_flags & OPf_KIDS) { OP* newop; @@ -4458,7 +4458,7 @@ ck_spair(OP *o) } OP * -ck_delete(OP *o) +Perl_ck_delete(pTHX_ OP *o) { o = ck_fun(o); o->op_private = 0; @@ -4467,7 +4467,7 @@ ck_delete(OP *o) if (kid->op_type == OP_HSLICE) o->op_private |= OPpSLICE; else if (kid->op_type != OP_HELEM) - croak("%s argument is not a HASH element or slice", + Perl_croak(aTHX_ "%s argument is not a HASH element or slice", PL_op_desc[o->op_type]); null(kid); } @@ -4475,7 +4475,7 @@ ck_delete(OP *o) } OP * -ck_eof(OP *o) +Perl_ck_eof(pTHX_ OP *o) { I32 type = o->op_type; @@ -4491,7 +4491,7 @@ ck_eof(OP *o) } OP * -ck_eval(OP *o) +Perl_ck_eval(pTHX_ OP *o) { PL_hints |= HINT_BLOCK_SCOPE; if (o->op_flags & OPf_KIDS) { @@ -4534,7 +4534,7 @@ ck_eval(OP *o) } OP * -ck_exec(OP *o) +Perl_ck_exec(pTHX_ OP *o) { OP *kid; if (o->op_flags & OPf_STACKED) { @@ -4549,13 +4549,13 @@ ck_exec(OP *o) } OP * -ck_exists(OP *o) +Perl_ck_exists(pTHX_ OP *o) { o = ck_fun(o); if (o->op_flags & OPf_KIDS) { OP *kid = cUNOPo->op_first; if (kid->op_type != OP_HELEM) - croak("%s argument is not a HASH element", PL_op_desc[o->op_type]); + Perl_croak(aTHX_ "%s argument is not a HASH element", PL_op_desc[o->op_type]); null(kid); } return o; @@ -4563,7 +4563,7 @@ ck_exists(OP *o) #if 0 OP * -ck_gvconst(register OP *o) +Perl_ck_gvconst(pTHX_ register OP *o) { o = fold_constants(o); if (o->op_type == OP_CONST) @@ -4573,7 +4573,7 @@ ck_gvconst(register OP *o) #endif OP * -ck_rvconst(register OP *o) +Perl_ck_rvconst(pTHX_ register OP *o) { dTHR; SVOP *kid = (SVOP*)cUNOPo->op_first; @@ -4620,7 +4620,7 @@ ck_rvconst(register OP *o) break; } if (badtype) - croak("Constant is not %s reference", badtype); + Perl_croak(aTHX_ "Constant is not %s reference", badtype); return o; } name = SvPV(kidsv, n_a); @@ -4638,7 +4638,7 @@ ck_rvconst(register OP *o) break; } if (badthing) - croak( + Perl_croak(aTHX_ "Can't use bareword (\"%s\") as %s ref while \"strict refs\" in use", name, badthing); } @@ -4674,7 +4674,7 @@ ck_rvconst(register OP *o) } OP * -ck_ftst(OP *o) +Perl_ck_ftst(pTHX_ OP *o) { dTHR; I32 type = o->op_type; @@ -4705,7 +4705,7 @@ ck_ftst(OP *o) } OP * -ck_fun(OP *o) +Perl_ck_fun(pTHX_ OP *o) { dTHR; register OP *kid; @@ -4764,7 +4764,7 @@ ck_fun(OP *o) OP *newop = newAVREF(newGVOP(OP_GV, 0, gv_fetchpv(name, TRUE, SVt_PVAV) )); if (ckWARN(WARN_SYNTAX)) - warner(WARN_SYNTAX, + Perl_warner(aTHX_ WARN_SYNTAX, "Array @%s missing the @ in argument %ld of %s()", name, (long)numargs, PL_op_desc[type]); op_free(kid); @@ -4784,7 +4784,7 @@ ck_fun(OP *o) OP *newop = newHVREF(newGVOP(OP_GV, 0, gv_fetchpv(name, TRUE, SVt_PVHV) )); if (ckWARN(WARN_SYNTAX)) - warner(WARN_SYNTAX, + Perl_warner(aTHX_ WARN_SYNTAX, "Hash %%%s missing the %% in argument %ld of %s()", name, (long)numargs, PL_op_desc[type]); op_free(kid); @@ -4879,7 +4879,7 @@ ck_fun(OP *o) } OP * -ck_glob(OP *o) +Perl_ck_glob(pTHX_ OP *o) { GV *gv; @@ -4912,7 +4912,7 @@ ck_glob(OP *o) } OP * -ck_grep(OP *o) +Perl_ck_grep(pTHX_ OP *o) { LOGOP *gwop; OP *kid; @@ -4941,7 +4941,7 @@ ck_grep(OP *o) return o; kid = cLISTOPo->op_first->op_sibling; if (kid->op_type != OP_NULL) - croak("panic: ck_grep"); + Perl_croak(aTHX_ "panic: ck_grep"); kid = kUNOP->op_first; gwop->op_type = type; @@ -4963,7 +4963,7 @@ ck_grep(OP *o) } OP * -ck_index(OP *o) +Perl_ck_index(pTHX_ OP *o) { if (o->op_flags & OPf_KIDS) { OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */ @@ -4976,21 +4976,21 @@ ck_index(OP *o) } OP * -ck_lengthconst(OP *o) +Perl_ck_lengthconst(pTHX_ OP *o) { /* XXX length optimization goes here */ return ck_fun(o); } OP * -ck_lfun(OP *o) +Perl_ck_lfun(pTHX_ OP *o) { OPCODE type = o->op_type; return modkids(ck_fun(o), type); } OP * -ck_defined(OP *o) /* 19990527 MJD */ +Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */ { dTHR; if (ckWARN(WARN_DEPRECATED)) { @@ -4998,13 +4998,13 @@ ck_defined(OP *o) /* 19990527 MJD */ case OP_RV2AV: case OP_PADAV: case OP_AASSIGN: /* Is this a good idea? */ - warner(WARN_DEPRECATED, "defined(@array) is deprecated (and not really meaningful)"); - warner(WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); + Perl_warner(aTHX_ WARN_DEPRECATED, "defined(@array) is deprecated (and not really meaningful)"); + Perl_warner(aTHX_ WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); break; case OP_RV2HV: case OP_PADHV: - warner(WARN_DEPRECATED, "defined(%hash) is deprecated (and not really meaningful)"); - warner(WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); + Perl_warner(aTHX_ WARN_DEPRECATED, "defined(%hash) is deprecated (and not really meaningful)"); + Perl_warner(aTHX_ WARN_DEPRECATED, "(Maybe you should just omit the defined()?)\n"); break; default: /* no warning */ @@ -5015,14 +5015,14 @@ ck_defined(OP *o) /* 19990527 MJD */ } OP * -ck_rfun(OP *o) +Perl_ck_rfun(pTHX_ OP *o) { OPCODE type = o->op_type; return refkids(ck_fun(o), type); } OP * -ck_listiob(OP *o) +Perl_ck_listiob(pTHX_ OP *o) { register OP *kid; @@ -5060,7 +5060,7 @@ ck_listiob(OP *o) } OP * -ck_fun_locale(OP *o) +Perl_ck_fun_locale(pTHX_ OP *o) { o = ck_fun(o); @@ -5074,7 +5074,7 @@ ck_fun_locale(OP *o) } OP * -ck_scmp(OP *o) +Perl_ck_scmp(pTHX_ OP *o) { o->op_private = 0; #ifdef USE_LOCALE @@ -5086,20 +5086,20 @@ ck_scmp(OP *o) } OP * -ck_match(OP *o) +Perl_ck_match(pTHX_ OP *o) { o->op_private |= OPpRUNTIME; return o; } OP * -ck_null(OP *o) +Perl_ck_null(pTHX_ OP *o) { return o; } OP * -ck_repeat(OP *o) +Perl_ck_repeat(pTHX_ OP *o) { if (cBINOPo->op_first->op_flags & OPf_PARENS) { o->op_private |= OPpREPEAT_DOLIST; @@ -5111,7 +5111,7 @@ ck_repeat(OP *o) } OP * -ck_require(OP *o) +Perl_ck_require(pTHX_ OP *o) { if (o->op_flags & OPf_KIDS) { /* Shall we supply missing .pm? */ SVOP *kid = (SVOP*)cUNOPo->op_first; @@ -5133,16 +5133,16 @@ ck_require(OP *o) #if 0 OP * -ck_retarget(OP *o) +Perl_ck_retarget(pTHX_ OP *o) { - croak("NOT IMPL LINE %d",__LINE__); + Perl_croak(aTHX_ "NOT IMPL LINE %d",__LINE__); /* STUB */ return o; } #endif OP * -ck_select(OP *o) +Perl_ck_select(pTHX_ OP *o) { OP* kid; if (o->op_flags & OPf_KIDS) { @@ -5162,7 +5162,7 @@ ck_select(OP *o) } OP * -ck_shift(OP *o) +Perl_ck_shift(pTHX_ OP *o) { I32 type = o->op_type; @@ -5191,7 +5191,7 @@ ck_shift(OP *o) } OP * -ck_sort(OP *o) +Perl_ck_sort(pTHX_ OP *o) { o->op_private = 0; #ifdef USE_LOCALE @@ -5243,7 +5243,7 @@ ck_sort(OP *o) } STATIC void -simplify_sort(pTHX_ OP *o) +S_simplify_sort(pTHX_ OP *o) { dTHR; register OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */ @@ -5305,7 +5305,7 @@ simplify_sort(pTHX_ OP *o) } OP * -ck_split(OP *o) +Perl_ck_split(pTHX_ OP *o) { register OP *kid; @@ -5314,7 +5314,7 @@ ck_split(OP *o) kid = cLISTOPo->op_first; if (kid->op_type != OP_NULL) - croak("panic: ck_split"); + Perl_croak(aTHX_ "panic: ck_split"); kid = kid->op_sibling; op_free(cLISTOPo->op_first); cLISTOPo->op_first = kid; @@ -5356,7 +5356,7 @@ ck_split(OP *o) } OP * -ck_subr(OP *o) +Perl_ck_subr(pTHX_ OP *o) { dTHR; OP *prev = ((cUNOPo->op_first->op_sibling) @@ -5503,7 +5503,7 @@ ck_subr(OP *o) continue; default: oops: - croak("Malformed prototype for %s: %s", + Perl_croak(aTHX_ "Malformed prototype for %s: %s", gv_ename(namegv), SvPV((SV*)cv, n_a)); } } @@ -5520,14 +5520,14 @@ ck_subr(OP *o) } OP * -ck_svconst(OP *o) +Perl_ck_svconst(pTHX_ OP *o) { SvREADONLY_on(cSVOPo->op_sv); return o; } OP * -ck_trunc(OP *o) +Perl_ck_trunc(pTHX_ OP *o) { if (o->op_flags & OPf_KIDS) { SVOP *kid = (SVOP*)cUNOPo->op_first; @@ -5682,8 +5682,8 @@ Perl_peep(pTHX_ register OP *o) line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = ((COP*)o->op_next)->cop_line; - warner(WARN_SYNTAX, "Statement unlikely to be reached"); - warner(WARN_SYNTAX, "(Maybe you meant system() when you said exec()?)\n"); + Perl_warner(aTHX_ WARN_SYNTAX, "Statement unlikely to be reached"); + Perl_warner(aTHX_ WARN_SYNTAX, "(Maybe you meant system() when you said exec()?)\n"); PL_curcop->cop_line = oldline; } } @@ -5714,12 +5714,12 @@ Perl_peep(pTHX_ register OP *o) key = SvPV(*svp, keylen); indsvp = hv_fetch(GvHV(*fields), key, keylen, FALSE); if (!indsvp) { - croak("No such field \"%s\" in variable %s of type %s", + Perl_croak(aTHX_ "No such field \"%s\" in variable %s of type %s", key, SvPV(lexname, n_a), HvNAME(SvSTASH(lexname))); } ind = SvIV(*indsvp); if (ind < 1) - croak("Bad index while coercing array into hash"); + Perl_croak(aTHX_ "Bad index while coercing array into hash"); rop->op_type = OP_RV2AV; rop->op_ppaddr = PL_ppaddr[OP_RV2AV]; o->op_type = OP_AELEM; |