CH] Change usage of regex/op common to common names
authorKarl Williamson <public@khwilliamson.com>
Sun, 26 Dec 2010 17:35:20 +0000 (10:35 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 17 Jan 2011 02:13:22 +0000 (19:13 -0700)
This patch changes the core functions to use the common names for the
fields that are shared between op.c and regcomp.c, just for consistency
of using one name throughout the core for the same thing.

A grep of cpan shows that both names are used in various modules; so
both names must be retained.

op.c
pp.c
pp_ctl.c
toke.c
universal.c

diff --git a/op.c b/op.c
index fbf3d71..b0a04dd 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3885,7 +3885,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
 
     if (expr->op_type == OP_CONST) {
        SV *pat = ((SVOP*)expr)->op_sv;
-       U32 pm_flags = pm->op_pmflags & PMf_COMPILETIME;
+       U32 pm_flags = pm->op_pmflags & RXf_PMf_COMPILETIME;
 
        if (o->op_flags & OPf_SPECIAL)
            pm_flags |= RXf_SPLIT;
diff --git a/pp.c b/pp.c
index 026eea1..edd4084 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -5925,7 +5925,7 @@ PP(pp_split)
                s++;
        }
     }
-    if (RX_EXTFLAGS(rx) & PMf_MULTILINE) {
+    if (RX_EXTFLAGS(rx) & RXf_PMf_MULTILINE) {
        multiline = 1;
     }
 
index 5a53565..06e3d8f 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -185,7 +185,7 @@ PP(pp_regcomp)
            memNE(RX_PRECOMP(re), t, len))
        {
            const regexp_engine *eng = re ? RX_ENGINE(re) : NULL;
-            U32 pm_flags = pm->op_pmflags & PMf_COMPILETIME;
+            U32 pm_flags = pm->op_pmflags & RXf_PMf_COMPILETIME;
            if (re) {
                ReREFCNT_dec(re);
 #ifdef USE_ITHREADS
diff --git a/toke.c b/toke.c
index 3d4bad1..cb096e9 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2834,7 +2834,7 @@ S_scan_const(pTHX_ char *start)
 
        /* likewise skip #-initiated comments in //x patterns */
        else if (*s == '#' && PL_lex_inpat &&
-         ((PMOP*)PL_lex_inpat)->op_pmflags & PMf_EXTENDED) {
+         ((PMOP*)PL_lex_inpat)->op_pmflags & RXf_PMf_EXTENDED) {
            while (s+1 < send && *s != '\n')
                *d++ = NATIVE_TO_NEED(has_utf8,*s++);
        }
@@ -12158,7 +12158,7 @@ S_pmflag(U32 pmfl, const char ch) {
     case GLOBAL_PAT_MOD:      pmfl |= PMf_GLOBAL; break;
     case CONTINUE_PAT_MOD:    pmfl |= PMf_CONTINUE; break;
     case ONCE_PAT_MOD:        pmfl |= PMf_KEEP; break;
-    case KEEPCOPY_PAT_MOD:    pmfl |= PMf_KEEPCOPY; break;
+    case KEEPCOPY_PAT_MOD:    pmfl |= RXf_PMf_KEEPCOPY; break;
     case NONDESTRUCT_PAT_MOD: pmfl |= PMf_NONDESTRUCT; break;
     }
     return pmfl;
index 96a92cf..07bbe96 100644 (file)
@@ -1174,7 +1174,7 @@ XS(XS_re_regexp_pattern)
                left += len;
            }
             fptr = INT_PAT_MODS;
-            match_flags = (U16)((RX_EXTFLAGS(re) & PMf_COMPILETIME)
+            match_flags = (U16)((RX_EXTFLAGS(re) & RXf_PMf_COMPILETIME)
                                     >> RXf_PMf_STD_PMMOD_SHIFT);
 
             while((ch = *fptr++)) {