summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-12-26 11:28:09 -0700
committerKarl Williamson <khw@cpan.org>2015-12-26 12:57:40 -0700
commit4cbce0a6b377e059ea536b5671a097422d236ec2 (patch)
tree460093cb367c7bf7d684ee0116593cd7d8002cf1 /regcomp.h
parentd1c40ef5b615823c7946ca520b1fedd807df469a (diff)
downloadperl-4cbce0a6b377e059ea536b5671a097422d236ec2.tar.gz
regcomp.h: Use more basic macro in #defines
Instead of having this code repeated in several places, call the more base macro from the others.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcomp.h b/regcomp.h
index f7c8cc40e7..deed70ec38 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -682,7 +682,7 @@ struct regnode_ssc {
#define ANYOF_BITMAP_ZERO(ret) Zero(((struct regnode_charclass*)(ret))->bitmap, ANYOF_BITMAP_SIZE, char)
#define ANYOF_BITMAP(p) (((struct regnode_charclass*)(p))->bitmap)
-#define ANYOF_BITMAP_BYTE(p, c) (ANYOF_BITMAP(p)[(((U8)(c)) >> 3) & 31])
+#define ANYOF_BITMAP_BYTE(p, c) BITMAP_BYTE(ANYOF_BITMAP(p), c)
#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) cBOOL(ANYOF_BITMAP_BYTE(p, c) & ANYOF_BIT(c))
@@ -908,7 +908,7 @@ typedef struct _reg_ac_data reg_ac_data;
three different sets... */
#define TRIE_BITMAP(p) (((reg_trie_data *)(p))->bitmap)
-#define TRIE_BITMAP_BYTE(p, c) (TRIE_BITMAP(p)[(((U8)(c)) >> 3) & 31])
+#define TRIE_BITMAP_BYTE(p, c) BITMAP_BYTE(TRIE_BITMAP(p), c)
#define TRIE_BITMAP_SET(p, c) (TRIE_BITMAP_BYTE(p, c) |= ANYOF_BIT((U8)c))
#define TRIE_BITMAP_CLEAR(p,c) (TRIE_BITMAP_BYTE(p, c) &= ~ANYOF_BIT((U8)c))
#define TRIE_BITMAP_TEST(p, c) (TRIE_BITMAP_BYTE(p, c) & ANYOF_BIT((U8)c))