From: Karl Williamson Date: Fri, 7 Dec 2012 03:35:03 +0000 (-0700) Subject: regcomp.h: Revise #define setup and checking X-Git-Tag: upstream/5.20.0~4542 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2ef2e3411630a6f82a5b9aeca6020b1a728af66;p=platform%2Fupstream%2Fperl.git regcomp.h: Revise #define setup and checking This revises how these #defines are set up so that the order can change (as will be done in a later commit), and the only dependencies are on VERTWS and the max one from handy.h. --- diff --git a/regcomp.h b/regcomp.h index 1c7f454..74ca44a 100644 --- a/regcomp.h +++ b/regcomp.h @@ -415,24 +415,27 @@ 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 ((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 below this, not stored in the class bitmap, but used as flags during compilation of char classes */ -#define ANYOF_VERTWS ((ANYOF_MAX)+0) -#define ANYOF_NVERTWS ((ANYOF_MAX)+1) +#define ANYOF_VERTWS ((_CC_VERTSPACE) * 2) +#define ANYOF_NVERTWS ((ANYOF_VERTWS)+1) -#if (ANYOF_VERTWS != (_CC_VERTSPACE) * 2) \ - || (_CC_VERTSPACE != _HIGHEST_REGCOMP_DOT_H_SYNC) -# error Problem with handy.h _CC_VERTSPACE #define +/* It is best if this is the last one, as all above it are stored as bits in a + * bitmap, and it isn't part of that bitmap */ +#if _CC_VERTSPACE != _HIGHEST_REGCOMP_DOT_H_SYNC +# error Problem with handy.h _HIGHEST_REGCOMP_DOT_H_SYNC #define +#endif + +#define ANYOF_MAX (ANYOF_VERTWS) /* So upper loop limit is written: + * '< ANYOF_MAX' + * Hence doesn't include VERTWS, as that + * is a pseudo class */ +#if (ANYOF_MAX > 32) /* Must fit in 32-bit word */ +# error Problem with handy.h _CC_foo #defines #endif -#define ANYOF_HORIZWS ((ANYOF_MAX)+2) +#define ANYOF_HORIZWS ((ANYOF_MAX)+2) /* = (ANYOF_NVERTWS + 1) */ #define ANYOF_NHORIZWS ((ANYOF_MAX)+3) #define ANYOF_UNIPROP ((ANYOF_MAX)+4) /* Used to indicate a Unicode