diff options
author | Zefram <zefram@fysh.org> | 2010-12-12 16:08:14 +0000 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-07-12 21:46:51 -0700 |
commit | cc76b5cc1552a60539ae1e99cc0b9817087d4bc4 (patch) | |
tree | 9409eb07ce6d196f836db8df318042986cf2e4a7 /op.c | |
parent | 68a9cf1a90f1a8fed74fdd419ad1ec538439e1c8 (diff) | |
download | perl-cc76b5cc1552a60539ae1e99cc0b9817087d4bc4.tar.gz |
APIify pad functions
Move several pad functions into the core API. Document the pad
functions more consistently for perlapi. Fix the interface issues
around delimitation of lexical variable names, providing _pvn, _pvs,
_pv, and _sv forms of pad_add_name and pad_findmy.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -415,7 +415,7 @@ Perl_allocmy(pTHX_ const char *const name, const STRLEN len, const U32 flags) /* allocate a spare slot and store the name in that slot */ - off = pad_add_name(name, len, + off = pad_add_name_pvn(name, len, is_our ? padadd_OUR : PL_parser->in_my == KEY_state ? padadd_STATE : 0, PL_parser->in_my_stash, @@ -2450,7 +2450,7 @@ STATIC OP * S_newDEFSVOP(pTHX) { dVAR; - const PADOFFSET offset = Perl_pad_findmy(aTHX_ STR_WITH_LEN("$_"), 0); + const PADOFFSET offset = pad_findmy_pvs("$_", 0); if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS_isOUR(offset)) { return newSVREF(newGVOP(OP_GV, 0, PL_defgv)); } @@ -5589,7 +5589,7 @@ Perl_newFOROP(pTHX_ I32 flags, OP *sv, OP *expr, OP *block, OP *cont) } } else { - const PADOFFSET offset = Perl_pad_findmy(aTHX_ STR_WITH_LEN("$_"), 0); + const PADOFFSET offset = pad_findmy_pvs("$_", 0); if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS_isOUR(offset)) { sv = newGVOP(OP_GV, 0, PL_defgv); } @@ -6923,7 +6923,7 @@ Perl_ck_anoncode(pTHX_ OP *o) { PERL_ARGS_ASSERT_CK_ANONCODE; - cSVOPo->op_targ = pad_add_anon(cSVOPo->op_sv, o->op_type); + cSVOPo->op_targ = pad_add_anon((CV*)cSVOPo->op_sv, o->op_type); if (!PL_madskills) cSVOPo->op_sv = NULL; return o; @@ -7761,7 +7761,7 @@ Perl_ck_grep(pTHX_ OP *o) gwop->op_flags |= OPf_KIDS; gwop->op_other = LINKLIST(kid); kid->op_next = (OP*)gwop; - offset = Perl_pad_findmy(aTHX_ STR_WITH_LEN("$_"), 0); + offset = pad_findmy_pvs("$_", 0); if (offset == NOT_IN_PAD || PAD_COMPNAME_FLAGS_isOUR(offset)) { o->op_private = gwop->op_private = 0; gwop->op_targ = pad_alloc(type, SVs_PADTMP); @@ -8011,7 +8011,7 @@ Perl_ck_match(pTHX_ OP *o) PERL_ARGS_ASSERT_CK_MATCH; if (o->op_type != OP_QR && PL_compcv) { - const PADOFFSET offset = Perl_pad_findmy(aTHX_ STR_WITH_LEN("$_"), 0); + const PADOFFSET offset = pad_findmy_pvs("$_", 0); if (offset != NOT_IN_PAD && !(PAD_COMPNAME_FLAGS_isOUR(offset))) { o->op_targ = offset; o->op_private |= OPpTARGET_MY; |