From 73134a2eb4055c76fe5b154da95e09118f716fd8 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 26 Dec 2010 10:35:20 -0700 Subject: [PATCH] CH] Change usage of regex/op common to common names 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 | 2 +- pp.c | 2 +- pp_ctl.c | 2 +- toke.c | 4 ++-- universal.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/op.c b/op.c index fbf3d71..b0a04dd 100644 --- 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 --- 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; } diff --git a/pp_ctl.c b/pp_ctl.c index 5a53565..06e3d8f 100644 --- 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 --- 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; diff --git a/universal.c b/universal.c index 96a92cf..07bbe96 100644 --- a/universal.c +++ b/universal.c @@ -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++)) { -- 1.8.3.1