Add DECC to the symbol list
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 0e1e6b8..20661f8 100644 (file)
--- a/op.c
+++ b/op.c
@@ -1379,12 +1379,12 @@ S_scalar_mod_type(pTHX_ const OP *o, I32 type)
 }
 
 STATIC bool
-S_is_handle_constructor(pTHX_ const OP *o, I32 argnum)
+S_is_handle_constructor(pTHX_ const OP *o, I32 numargs)
 {
     switch (o->op_type) {
     case OP_PIPE_OP:
     case OP_SOCKPAIR:
-       if (argnum == 2)
+       if (numargs == 2)
            return TRUE;
        /* FALL THROUGH */
     case OP_SYSOPEN:
@@ -1393,7 +1393,7 @@ S_is_handle_constructor(pTHX_ const OP *o, I32 argnum)
     case OP_SOCKET:
     case OP_OPEN_DIR:
     case OP_ACCEPT:
-       if (argnum == 1)
+       if (numargs == 1)
            return TRUE;
        /* FALL THROUGH */
     default:
@@ -1535,7 +1535,7 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs, bool for_my)
     ENTER;             /* need to protect against side-effects of 'use' */
     SAVEINT(PL_expect);
     if (stash)
-       stashsv = newSVpv(HvNAME_get(stash), 0);
+       stashsv = newSVpvn(HvNAME_get(stash), HvNAMELEN_get(stash));
     else
        stashsv = &PL_sv_no;
 
@@ -1543,9 +1543,8 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs, bool for_my)
 #define ATTRSMODULE_PM "attributes.pm"
 
     if (for_my) {
-       SV **svp;
        /* Don't force the C<use> if we don't need it. */
-       svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
+       SV **svp = hv_fetch(GvHVn(PL_incgv), ATTRSMODULE_PM,
                       sizeof(ATTRSMODULE_PM)-1, 0);
        if (svp && *svp != &PL_sv_undef)
            ;           /* already in %INC */
@@ -1589,7 +1588,7 @@ S_apply_attrs_my(pTHX_ HV *stash, OP *target, OP *attrs, OP **imopsp)
 
     /* Build up the real arg-list. */
     if (stash)
-       stashsv = newSVpv(HvNAME_get(stash), 0);
+       stashsv = newSVpvn(HvNAME_get(stash), HvNAMELEN_get(stash));
     else
        stashsv = &PL_sv_no;
     arg = newOP(OP_PADSV, 0);
@@ -3226,7 +3225,7 @@ Perl_newSLICEOP(pTHX_ I32 flags, OP *subscript, OP *listval)
 }
 
 STATIC I32
-S_list_assignment(pTHX_ register const OP *o)
+S_is_list_assignment(pTHX_ register const OP *o)
 {
     if (!o)
        return TRUE;
@@ -3235,8 +3234,8 @@ S_list_assignment(pTHX_ register const OP *o)
        o = cUNOPo->op_first;
 
     if (o->op_type == OP_COND_EXPR) {
-        const I32 t = list_assignment(cLOGOPo->op_first->op_sibling);
-        const I32 f = list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
+        const I32 t = is_list_assignment(cLOGOPo->op_first->op_sibling);
+        const I32 f = is_list_assignment(cLOGOPo->op_first->op_sibling->op_sibling);
 
        if (t && f)
            return TRUE;
@@ -3281,7 +3280,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
        }
     }
 
-    if (list_assignment(left)) {
+    if (is_list_assignment(left)) {
        OP *curop;
 
        PL_modcount = 0;
@@ -4653,6 +4652,7 @@ Perl_newXS(pTHX_ const char *name, XSUBADDR_t subaddr, const char *filename)
        }
        else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
            /* already defined (or promised) */
+           /* XXX It's possible for this HvNAME_get to return null, and get passed into strEQ */
            if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
                            && strEQ(HvNAME_get(GvSTASH(CvGV(cv))), "autouse"))) {
                const line_t oldline = CopLINE(PL_curcop);
@@ -4960,8 +4960,8 @@ Perl_ck_bitop(pTHX_ OP *o)
             || o->op_type == OP_BIT_AND
             || o->op_type == OP_BIT_XOR))
     {
-       const OP * left = cBINOPo->op_first;
-       const OP * right = left->op_sibling;
+       const OP * const left = cBINOPo->op_first;
+       const OP * const right = left->op_sibling;
        if ((OP_IS_NUMCOMPARE(left->op_type) &&
                (left->op_flags & OPf_PARENS) == 0) ||
            (OP_IS_NUMCOMPARE(right->op_type) &&
@@ -5162,17 +5162,6 @@ Perl_ck_exists(pTHX_ OP *o)
     return o;
 }
 
-#if 0
-OP *
-Perl_ck_gvconst(pTHX_ register OP *o)
-{
-    o = fold_constants(o);
-    if (o->op_type == OP_CONST)
-       o->op_type = OP_GV;
-    return o;
-}
-#endif
-
 OP *
 Perl_ck_rvconst(pTHX_ register OP *o)
 {
@@ -5183,12 +5172,12 @@ Perl_ck_rvconst(pTHX_ register OP *o)
     if (kid->op_type == OP_CONST) {
        int iscv;
        GV *gv;
-       SV *kidsv = kid->op_sv;
+       SV * const kidsv = kid->op_sv;
 
        /* Is it a constant from cv_const_sv()? */
        if (SvROK(kidsv) && SvREADONLY(kidsv)) {
            SV *rsv = SvRV(kidsv);
-           int svtype = SvTYPE(rsv);
+           const int svtype = SvTYPE(rsv);
             const char *badtype = Nullch;
 
            switch (o->op_type) {