This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.h: Remove some no-longer used #defines
[perl5.git] / regcomp.h
index 3bb1a53..055a56d 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -184,8 +184,9 @@ struct regnode_2 {
     U16 arg2;
 };
 
+#define NUM_ANYOF_CODE_POINTS   256
 
-#define ANYOF_BITMAP_SIZE      (256 / 8)   /* 8 bits/Byte */
+#define ANYOF_BITMAP_SIZE      (NUM_ANYOF_CODE_POINTS / 8)   /* 8 bits/Byte */
 
 /* Note that these form structs which are supersets of the next smaller one, by
  * appending fields.  Alignment problems can occur if one of those optional
@@ -346,7 +347,7 @@ struct regnode_ssc {
 #define PASS1 SIZE_ONLY
 #define PASS2 (! SIZE_ONLY)
 
-/* If the bitmap doesn't fully represent what this ANYOF node can match, the
+/* If the bitmap fully represents what this ANYOF node can match, the
  * ARG is set to this special value (since 0, 1, ... are legal, but will never
  * reach this high). */
 #define ANYOF_NONBITMAP_EMPTY  ((U32) -1)
@@ -389,8 +390,6 @@ struct regnode_ssc {
  * and the optimizer's synthetic start class.  Non-locale \d, etc are resolved
  * at compile-time */
 #define ANYOF_POSIXL            0x08
-#define ANYOF_CLASS             ANYOF_POSIXL
-#define ANYOF_LARGE              ANYOF_POSIXL
 
 /* Should we raise a warning if matching against an above-Unicode code point?
  * */
@@ -401,7 +400,6 @@ struct regnode_ssc {
 
 /* Matches every code point 0x100 and above*/
 #define ANYOF_ABOVE_LATIN1_ALL  0x40
-#define ANYOF_UNICODE_ALL       ANYOF_ABOVE_LATIN1_ALL
 
 /* Match all Latin1 characters that aren't ASCII when the target string is not
  * in utf8. */
@@ -499,7 +497,7 @@ struct regnode_ssc {
 
 #define ANYOF_FLAGS(p)         ((p)->flags)
 
-#define ANYOF_BIT(c)           (1 << ((c) & 7))
+#define ANYOF_BIT(c)           (1U << ((c) & 7))
 
 #define ANYOF_POSIXL_SET(p, c) (((regnode_charclass_posixl*) (p))->classflags |= (1U << (c)))
 #define ANYOF_CLASS_SET(p, c)  ANYOF_POSIXL_SET((p), (c))
@@ -545,15 +543,12 @@ struct regnode_ssc {
 #define ANYOF_BITMAP_BYTE(p, c)        (ANYOF_BITMAP(p)[(((U8)(c)) >> 3) & 31])
 #define ANYOF_BITMAP_SET(p, c) (ANYOF_BITMAP_BYTE(p, c) |=  ANYOF_BIT(c))
 #define ANYOF_BITMAP_CLEAR(p,c)        (ANYOF_BITMAP_BYTE(p, c) &= ~ANYOF_BIT(c))
-#define ANYOF_BITMAP_TEST(p, c)        (ANYOF_BITMAP_BYTE(p, c) &   ANYOF_BIT(c))
+#define ANYOF_BITMAP_TEST(p, c)        cBOOL(ANYOF_BITMAP_BYTE(p, c) &   ANYOF_BIT(c))
 
 #define ANYOF_BITMAP_SETALL(p)         \
        memset (ANYOF_BITMAP(p), 255, ANYOF_BITMAP_SIZE)
 #define ANYOF_BITMAP_CLEARALL(p)       \
        Zero (ANYOF_BITMAP(p), ANYOF_BITMAP_SIZE)
-/* Check that all 256 bits are all set.  Used in S_cl_is_anything()  */
-#define ANYOF_BITMAP_TESTALLSET(p)     /* Assumes sizeof(p) == 32 */     \
-       memEQ (ANYOF_BITMAP(p), "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377", ANYOF_BITMAP_SIZE)
 
 #define ANYOF_SKIP             ((ANYOF_SIZE - 1)/sizeof(regnode))
 #define ANYOF_POSIXL_SKIP      ((ANYOF_POSIXL_SIZE - 1)/sizeof(regnode))