Change 32774 by [EMAIL PROTECTED] on 2007/12/29 15:11:04
The position of the modifier flag bits is actually encoded by a right
shift 12 in two places, so replace that magic number with a macro
RXf_PMf_STD_PMMOD_SHIFT defined adjacent to the flags it interacts
with.
Affected files ...
... //depot/perl/ext/re/re.xs#54 edit
... //depot/perl/regcomp.c#628 edit
... //depot/perl/regexp.h#117 edit
Differences ...
==== //depot/perl/ext/re/re.xs#54 (text) ====
Index: perl/ext/re/re.xs
--- perl/ext/re/re.xs#53~32758~ 2007-12-28 16:17:41.000000000 -0800
+++ perl/ext/re/re.xs 2007-12-29 07:11:04.000000000 -0800
@@ -107,7 +107,8 @@
const char *fptr = INT_PAT_MODS;
char ch;
- U16 match_flags = (U16)((re->extflags & PMf_COMPILETIME) >> 12);
+ U16 match_flags = (U16)((re->extflags & PMf_COMPILETIME)
+ >> RXf_PMf_STD_PMMOD_SHIFT);
while((ch = *fptr++)) {
if(match_flags & 1) {
==== //depot/perl/regcomp.c#628 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#627~32758~ 2007-12-28 16:17:41.000000000 -0800
+++ perl/regcomp.c 2007-12-29 07:11:04.000000000 -0800
@@ -4286,7 +4286,8 @@
bool has_p = ((r->extflags & RXf_PMf_KEEPCOPY) ==
RXf_PMf_KEEPCOPY);
bool has_minus = ((r->extflags & RXf_PMf_STD_PMMOD) !=
RXf_PMf_STD_PMMOD);
bool has_runon = ((RExC_seen &
REG_SEEN_RUN_ON_COMMENT)==REG_SEEN_RUN_ON_COMMENT);
- U16 reganch = (U16)((r->extflags & RXf_PMf_STD_PMMOD) >> 12);
+ U16 reganch = (U16)((r->extflags & RXf_PMf_STD_PMMOD)
+ >> RXf_PMf_STD_PMMOD_SHIFT);
const char *fptr = STD_PAT_MODS; /*"msix"*/
char *p;
RX_WRAPLEN(r) = plen + has_minus + has_p + has_runon
==== //depot/perl/regexp.h#117 (text) ====
Index: perl/regexp.h
--- perl/regexp.h#116~32759~ 2007-12-29 03:49:09.000000000 -0800
+++ perl/regexp.h 2007-12-29 07:11:04.000000000 -0800
@@ -255,6 +255,7 @@
#define RXf_PMf_EXTENDED 0x00008000 /* /x */
#define RXf_PMf_KEEPCOPY 0x00010000 /* /p */
/* these flags are transfered from the PMOP->op_pmflags member during
compilation */
+#define RXf_PMf_STD_PMMOD_SHIFT 12
#define RXf_PMf_STD_PMMOD
(RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED)
#define RXf_PMf_COMPILETIME
(RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_LOCALE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_KEEPCOPY)
End of Patch.