summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-08-15 21:32:30 -0600
committerKarl Williamson <public@khwilliamson.com>2012-11-19 17:13:00 -0700
commit87cad4c09451b76f5dcf8b493f84dc07cc915ce6 (patch)
tree11038cff88fdc4e06decf1f6155be72e551c83f8
parent9e84774b2a68a51af5e246f365059d61ebe86fb0 (diff)
downloadperl-87cad4c09451b76f5dcf8b493f84dc07cc915ce6.tar.gz
regcomp.h: Make some #defines sequential
ANYOF_MAX is used as the upper boundary in loops. If we keep it larger than necessary, the loop does extraneous iterations. The #defines that come after ANYOF_MAX are moved down to start with it. This is useful in a later commit that will create an entry in l1_char_class_tab.h for vertical white space determination.
-rw-r--r--regcomp.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/regcomp.h b/regcomp.h
index 1f6f765799..e9c9c4ca75 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -415,21 +415,23 @@ struct regnode_charclass_class {
#define ANYOF_BLANK ((_CC_BLANK) * 2) /* GNU extension: space and tab: non-vertical space */
#define ANYOF_NBLANK ((ANYOF_BLANK) + 1)
-#define ANYOF_MAX 32
-#if (ANYOF_MAX <= _HIGHEST_REGCOMP_DOT_H_SYNC * 2 + 1)
+#define ANYOF_MAX ((ANYOF_NBLANK) + 1) /* So upper loop limit is written:
+ '< ANYOF_MAX' */
+#if (ANYOF_MAX > 32) /* Must fit in 32-bit word */
# error Problem with handy.h _CC_foo #defines
#endif
-/* pseudo classes, not stored in the class bitmap, but used as flags
+/* pseudo classes below this, not stored in the class bitmap, but used as flags
during compilation of char classes */
-#define ANYOF_VERTWS (ANYOF_MAX+1)
-#define ANYOF_NVERTWS (ANYOF_MAX+2)
-#define ANYOF_HORIZWS (ANYOF_MAX+3)
-#define ANYOF_NHORIZWS (ANYOF_MAX+4)
+#define ANYOF_VERTWS ((ANYOF_MAX)+0)
+#define ANYOF_NVERTWS ((ANYOF_MAX)+1)
-#define ANYOF_UNIPROP (ANYOF_MAX+5) /* Used to indicate a Unicode property:
- \p{} or \P{} */
+#define ANYOF_HORIZWS ((ANYOF_MAX)+2)
+#define ANYOF_NHORIZWS ((ANYOF_MAX)+3)
+
+#define ANYOF_UNIPROP ((ANYOF_MAX)+4) /* Used to indicate a Unicode
+ property: \p{} or \P{} */
/* Backward source code compatibility. */