X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=regcomp.h;h=0bd00e2a6dcb38b9612f797d1c508faca6b2f032;hb=43051805d53a3e4c5b2185a17655cab5bedc17ed;hp=a09ade7a87e0c447d729230cbbb72067ecfeb5d8;hpb=d6582e46845f6c37893e96dbdd201cd0601d3550;p=p5sagit%2Fp5-mst-13.2.git diff --git a/regcomp.h b/regcomp.h index a09ade7..0bd00e2 100644 --- a/regcomp.h +++ b/regcomp.h @@ -271,7 +271,10 @@ struct regnode_2 { #endif -#define REG_INFTY I16_MAX +/* I16_MAX is no good for REG_INFTY because sizeof(short) > 2 + * is perfectly fine. In Cray C90 sizeof(short) == 4, + * in Cray T90 sizeof(short) == 8. */ +#define REG_INFTY ((1<<15)-1) #ifdef REGALIGN # define ARG_VALUE(arg) (arg) @@ -367,6 +370,13 @@ typedef char* regnode; #define ANYOF_SPACEL 0x02 #define ANYOF_NSPACEL 0x01 +/* Utility macros for bitmap of ANYOF */ +#define ANYOF_BYTE(p,c) (p)[1 + (((c) >> 3) & 31)] +#define ANYOF_BIT(c) (1 << ((c) & 7)) +#define ANYOF_SET(p,c) (ANYOF_BYTE(p,c) |= ANYOF_BIT(c)) +#define ANYOF_CLEAR(p,c) (ANYOF_BYTE(p,c) &= ~ANYOF_BIT(c)) +#define ANYOF_TEST(p,c) (ANYOF_BYTE(p,c) & ANYOF_BIT(c)) + #ifdef REGALIGN_STRUCT #define ANY_SKIP ((33 - 1)/sizeof(regnode) + 1) #else @@ -445,5 +455,5 @@ const static char reg_off_by_arg[] = { #define REG_SEEN_GPOS 4 #ifdef DEBUGGING -extern char *colors[4]; +EXT char *colors[4]; /* not dEXT since we do EXTERN/INTERN.h shuffle */ #endif