summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2010-07-31 22:18:42 -0600
committerRafael Garcia-Suarez <rgs@consttype.org>2010-08-11 10:23:35 +0200
commit1ad4ec548311231461a68d0e66335fc3abf1540f (patch)
tree30cece4eeea6678c3f150946574520dbd7a9296f
parent5b126c844328624724495878ae8a120ab1a2e906 (diff)
downloadperl-1ad4ec548311231461a68d0e66335fc3abf1540f.tar.gz
op.h, regexp.h: renumber shifts.
This patch doesn't change any generated code. It just changes the base numbering of the shifts from 1 to 0. In regexp.h the RXf_BASE_SHIFT was changed to make sure the used bits didn't change
-rw-r--r--op.h24
-rw-r--r--regexp.h50
2 files changed, 37 insertions, 37 deletions
diff --git a/op.h b/op.h
index 6bf996d9da..0102e368d1 100644
--- a/op.h
+++ b/op.h
@@ -360,39 +360,39 @@ struct pmop {
#define PM_SETRE(o,r) ((o)->op_pmregexp = (r))
#endif
-#define PMf_BASE_SHIFT ((_RXf_PMf_SHIFT_NEXT)-1)
+#define PMf_BASE_SHIFT _RXf_PMf_SHIFT_NEXT
/* taint $1 etc. if target tainted */
-#define PMf_RETAINT (1<<(PMf_BASE_SHIFT+1))
+#define PMf_RETAINT (1<<(PMf_BASE_SHIFT+0))
/* match successfully only once per reset, with related flag RXf_USED in
* re->extflags holding state. This is used only for ?? matches, and only on
* OP_MATCH and OP_QR */
-#define PMf_ONCE (1<<(PMf_BASE_SHIFT+2))
+#define PMf_ONCE (1<<(PMf_BASE_SHIFT+1))
/* replacement contains variables */
-#define PMf_MAYBE_CONST (1<<(PMf_BASE_SHIFT+3))
+#define PMf_MAYBE_CONST (1<<(PMf_BASE_SHIFT+2))
/* PMf_ONCE has matched successfully. Not used under threading. */
-#define PMf_USED (1<<(PMf_BASE_SHIFT+4))
+#define PMf_USED (1<<(PMf_BASE_SHIFT+3))
/* subst replacement is constant */
-#define PMf_CONST (1<<(PMf_BASE_SHIFT+5))
+#define PMf_CONST (1<<(PMf_BASE_SHIFT+4))
/* keep 1st runtime pattern forever */
-#define PMf_KEEP (1<<(PMf_BASE_SHIFT+6))
-#define PMf_GLOBAL (1<<(PMf_BASE_SHIFT+7)) /* pattern had a g modifier */
+#define PMf_KEEP (1<<(PMf_BASE_SHIFT+5))
+#define PMf_GLOBAL (1<<(PMf_BASE_SHIFT+6)) /* pattern had a g modifier */
/* don't reset pos() if //g fails */
-#define PMf_CONTINUE (1<<(PMf_BASE_SHIFT+8))
+#define PMf_CONTINUE (1<<(PMf_BASE_SHIFT+7))
/* evaluating replacement as expr */
-#define PMf_EVAL (1<<(PMf_BASE_SHIFT+9))
+#define PMf_EVAL (1<<(PMf_BASE_SHIFT+8))
/* Return substituted string instead of modifying it. */
-#define PMf_NONDESTRUCT (1<<(PMf_BASE_SHIFT+10))
+#define PMf_NONDESTRUCT (1<<(PMf_BASE_SHIFT+9))
-#if PMf_BASE_SHIFT+10 > 31
+#if PMf_BASE_SHIFT+9 > 31
# error Too many PMf_ bits used. See above and regnodes.h for any spare in middle
#endif
diff --git a/regexp.h b/regexp.h
index 83a7e8d841..f041177496 100644
--- a/regexp.h
+++ b/regexp.h
@@ -281,57 +281,57 @@ and check for NULL.
*
*/
-#define RXf_BASE_SHIFT ((_RXf_PMf_SHIFT_NEXT)-1)
+#define RXf_BASE_SHIFT (_RXf_PMf_SHIFT_NEXT+2)
/* Anchor and GPOS related stuff */
-#define RXf_ANCH_BOL (1<<(RXf_BASE_SHIFT+3))
-#define RXf_ANCH_MBOL (1<<(RXf_BASE_SHIFT+4))
-#define RXf_ANCH_SBOL (1<<(RXf_BASE_SHIFT+5))
-#define RXf_ANCH_GPOS (1<<(RXf_BASE_SHIFT+6))
-#define RXf_GPOS_SEEN (1<<(RXf_BASE_SHIFT+7))
-#define RXf_GPOS_FLOAT (1<<(RXf_BASE_SHIFT+8))
+#define RXf_ANCH_BOL (1<<(RXf_BASE_SHIFT+0))
+#define RXf_ANCH_MBOL (1<<(RXf_BASE_SHIFT+1))
+#define RXf_ANCH_SBOL (1<<(RXf_BASE_SHIFT+2))
+#define RXf_ANCH_GPOS (1<<(RXf_BASE_SHIFT+3))
+#define RXf_GPOS_SEEN (1<<(RXf_BASE_SHIFT+4))
+#define RXf_GPOS_FLOAT (1<<(RXf_BASE_SHIFT+5))
/* two bits here */
#define RXf_ANCH (RXf_ANCH_BOL|RXf_ANCH_MBOL|RXf_ANCH_GPOS|RXf_ANCH_SBOL)
#define RXf_GPOS_CHECK (RXf_GPOS_SEEN|RXf_ANCH_GPOS)
#define RXf_ANCH_SINGLE (RXf_ANCH_SBOL|RXf_ANCH_GPOS)
/* What we have seen */
-#define RXf_LOOKBEHIND_SEEN (1<<(RXf_BASE_SHIFT+9))
-#define RXf_EVAL_SEEN (1<<(RXf_BASE_SHIFT+10))
-#define RXf_CANY_SEEN (1<<(RXf_BASE_SHIFT+11))
+#define RXf_LOOKBEHIND_SEEN (1<<(RXf_BASE_SHIFT+6))
+#define RXf_EVAL_SEEN (1<<(RXf_BASE_SHIFT+7))
+#define RXf_CANY_SEEN (1<<(RXf_BASE_SHIFT+8))
/* Special */
-#define RXf_NOSCAN (1<<(RXf_BASE_SHIFT+12))
-#define RXf_CHECK_ALL (1<<(RXf_BASE_SHIFT+13))
+#define RXf_NOSCAN (1<<(RXf_BASE_SHIFT+9))
+#define RXf_CHECK_ALL (1<<(RXf_BASE_SHIFT+10))
/* UTF8 related */
-#define RXf_MATCH_UTF8 (1<<(RXf_BASE_SHIFT+15))
+#define RXf_MATCH_UTF8 (1<<(RXf_BASE_SHIFT+12))
/* Intuit related */
-#define RXf_USE_INTUIT_NOML (1<<(RXf_BASE_SHIFT+16))
-#define RXf_USE_INTUIT_ML (1<<(RXf_BASE_SHIFT+17))
-#define RXf_INTUIT_TAIL (1<<(RXf_BASE_SHIFT+18))
+#define RXf_USE_INTUIT_NOML (1<<(RXf_BASE_SHIFT+13))
+#define RXf_USE_INTUIT_ML (1<<(RXf_BASE_SHIFT+14))
+#define RXf_INTUIT_TAIL (1<<(RXf_BASE_SHIFT+15))
/*
Set in Perl_pmruntime if op_flags & OPf_SPECIAL, i.e. split. Will
be used by regex engines to check whether they should set
RXf_SKIPWHITE
*/
-#define RXf_SPLIT (1<<(RXf_BASE_SHIFT+19))
+#define RXf_SPLIT (1<<(RXf_BASE_SHIFT+16))
#define RXf_USE_INTUIT (RXf_USE_INTUIT_NOML|RXf_USE_INTUIT_ML)
/* Copy and tainted info */
-#define RXf_COPY_DONE (1<<(RXf_BASE_SHIFT+20))
-#define RXf_TAINTED_SEEN (1<<(RXf_BASE_SHIFT+21))
-#define RXf_TAINTED (1<<(RXf_BASE_SHIFT+22)) /* this pattern is tainted */
+#define RXf_COPY_DONE (1<<(RXf_BASE_SHIFT+17))
+#define RXf_TAINTED_SEEN (1<<(RXf_BASE_SHIFT+18))
+#define RXf_TAINTED (1<<(RXf_BASE_SHIFT+19)) /* this pattern is tainted */
/* Flags indicating special patterns */
-#define RXf_START_ONLY (1<<(RXf_BASE_SHIFT+23)) /* Pattern is /^/ */
-#define RXf_SKIPWHITE (1<<(RXf_BASE_SHIFT+24)) /* Pattern is for a split / / */
-#define RXf_WHITE (1<<(RXf_BASE_SHIFT+25)) /* Pattern is /\s+/ */
-#define RXf_NULL (1<<(RXf_BASE_SHIFT+26)) /* Pattern is // */
-#if RXf_BASE_SHIFT+26 > 31
+#define RXf_START_ONLY (1<<(RXf_BASE_SHIFT+20)) /* Pattern is /^/ */
+#define RXf_SKIPWHITE (1<<(RXf_BASE_SHIFT+21)) /* Pattern is for a split / / */
+#define RXf_WHITE (1<<(RXf_BASE_SHIFT+22)) /* Pattern is /\s+/ */
+#define RXf_NULL (1<<(RXf_BASE_SHIFT+23)) /* Pattern is // */
+#if RXf_BASE_SHIFT+23 > 31
# error Too many RXf_PMf bits used. See regnodes.h for any spare in middle
#endif