Re: Proposed changes and to regular expression interfaces in core
[p5sagit/p5-mst-13.2.git] / pp.c
diff --git a/pp.c b/pp.c
index e1a45c1..bec9933 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -251,17 +251,17 @@ Perl_softref2xv(pTHX_ SV *const sv, const char *const what, const U32 type,
     if ((PL_op->op_flags & OPf_SPECIAL) &&
        !(PL_op->op_flags & OPf_MOD))
        {
-           gv = (GV*)gv_fetchsv(sv, 0, type);
+           gv = gv_fetchsv(sv, 0, type);
            if (!gv
                && (!is_gv_magical_sv(sv,0)
-                   || !(gv = (GV*)gv_fetchsv(sv, GV_ADD, type))))
+                   || !(gv = gv_fetchsv(sv, GV_ADD, type))))
                {
                    **spp = &PL_sv_undef;
                    return NULL;
                }
        }
     else {
-       gv = (GV*)gv_fetchsv(sv, GV_ADD, type);
+       gv = gv_fetchsv(sv, GV_ADD, type);
     }
     return gv;
 }
@@ -323,8 +323,7 @@ PP(pp_av2arylen)
     AV * const av = (AV*)TOPs;
     SV ** const sv = Perl_av_arylen_p(aTHX_ (AV*)av);
     if (!*sv) {
-       *sv = newSV(0);
-       sv_upgrade(*sv, SVt_PVMG);
+       *sv = newSV_type(SVt_PVMG);
        sv_magic(*sv, (SV*)av, PERL_MAGIC_arylen, NULL, 0);
     }
     SETs(*sv);
@@ -1538,7 +1537,7 @@ PP(pp_repeat)
                SvCUR_set(TARG, 0);
            else {
                const STRLEN max = (UV)count * len;
-               if (len > ((MEM_SIZE)~0)/count)
+               if (len > MEM_SIZE_MAX / count)
                     Perl_croak(aTHX_ oom_string_extend);
                MEM_WRAP_CHECK_1(max, char, oom_string_extend);
                SvGROW(TARG, max + 1);
@@ -4568,8 +4567,8 @@ PP(pp_split)
        DIE(aTHX_ "panic: pp_split");
     rx = PM_GETRE(pm);
 
-    TAINT_IF((pm->op_pmflags & PMf_LOCALE) &&
-            (pm->op_pmflags & (PMf_WHITE | PMf_SKIPWHITE)));
+    TAINT_IF((rx->extflags & RXf_PMf_LOCALE) &&
+            (rx->extflags & (RXf_WHITE | RXf_SKIPWHITE)));
 
     RX_MATCH_UTF8_set(rx, do_utf8);
 
@@ -4609,12 +4608,12 @@ PP(pp_split)
     }
     base = SP - PL_stack_base;
     orig = s;
-    if (pm->op_pmflags & PMf_SKIPWHITE) {
+    if (rx->extflags & RXf_SKIPWHITE) {
        if (do_utf8) {
            while (*s == ' ' || is_utf8_space((U8*)s))
                s += UTF8SKIP(s);
        }
-       else if (pm->op_pmflags & PMf_LOCALE) {
+       else if (rx->extflags & RXf_PMf_LOCALE) {
            while (isSPACE_LC(*s))
                s++;
        }
@@ -4623,13 +4622,13 @@ PP(pp_split)
                s++;
        }
     }
-    if (pm->op_pmflags & PMf_MULTILINE) {
+    if (rx->extflags & PMf_MULTILINE) {
        multiline = 1;
     }
 
     if (!limit)
        limit = maxiters + 2;
-    if (pm->op_pmflags & PMf_WHITE) {
+    if (rx->extflags & RXf_WHITE) {
        while (--limit) {
            m = s;
            /* this one uses 'm' and is a negative test */
@@ -4642,7 +4641,7 @@ PP(pp_split)
                    else
                        m += t;
                }
-            } else if (pm->op_pmflags & PMf_LOCALE) {
+            } else if (rx->extflags & RXf_PMf_LOCALE) {
                while (m < strend && !isSPACE_LC(*m))
                    ++m;
             } else {
@@ -4669,7 +4668,7 @@ PP(pp_split)
            if (do_utf8) {
                while (s < strend && ( *s == ' ' || is_utf8_space((U8*)s) ))
                    s +=  UTF8SKIP(s);
-            } else if (pm->op_pmflags & PMf_LOCALE) {
+            } else if (rx->extflags & RXf_PMf_LOCALE) {
                while (s < strend && isSPACE_LC(*s))
                    ++s;
             } else {
@@ -4762,7 +4761,7 @@ PP(pp_split)
                s = orig + (m - s);
                strend = s + (strend - m);
            }
-           m = rx->startp[0] + orig;
+           m = rx->offs[0].start + orig;
            dstr = newSVpvn(s, m-s);
            if (make_mortal)
                sv_2mortal(dstr);
@@ -4772,8 +4771,8 @@ PP(pp_split)
            if (rx->nparens) {
                I32 i;
                for (i = 1; i <= (I32)rx->nparens; i++) {
-                   s = rx->startp[i] + orig;
-                   m = rx->endp[i] + orig;
+                   s = rx->offs[i].start + orig;
+                   m = rx->offs[i].end + orig;
 
                    /* japhy (07/27/01) -- the (m && s) test doesn't catch
                       parens that didn't match -- they should be set to
@@ -4790,7 +4789,7 @@ PP(pp_split)
                    XPUSHs(dstr);
                }
            }
-           s = rx->endp[0] + orig;
+           s = rx->offs[0].end + orig;
        }
     }