diff options
author | Karl Williamson <khw@cpan.org> | 2014-08-28 14:36:15 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-09-03 12:43:15 -0600 |
commit | bc51fd7848385e58210a13810ef5ac6f01f70afb (patch) | |
tree | fa510941b3e658e01c2e1299c17831e44be0df93 /regcomp.h | |
parent | 6f16c8da34619f286a6f24a2d6286f398d3b4503 (diff) | |
download | perl-bc51fd7848385e58210a13810ef5ac6f01f70afb.tar.gz |
regcomp.h: Use unsigned 1 in left shift
This prevents a signed result if this macro ever gets used in a U8.
The ANYOF_BITMAP_TEST macro must now be cast or it would generate warnings
when compiled with -DPERL_BOOL_AS_CHAR
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -500,7 +500,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)) @@ -546,7 +546,7 @@ 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) |