diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1999-08-02 17:53:36 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-03 09:29:22 +0000 |
commit | cd439c502eb7c742eb6cf76c8359a4d3384ae0f5 (patch) | |
tree | 004c460476a9da35fe29b26b2e8d2d94438c4ba4 /regcomp.h | |
parent | 8d3f0e046561ce8c2415d2f9fb335f3ab8fa9d70 (diff) | |
download | perl-cd439c502eb7c742eb6cf76c8359a4d3384ae0f5.tar.gz |
Clarify RE engine code; inline a static function to a macro;
make exact string nodes smaller.
To: perl5-porters@perl.org (Mailing list Perl5)
Subject: [PATCH 5.005_60] Cosmetic change to REx engine
Message-Id: <199908030153.VAA10542@monk.mps.ohio-state.edu>
p4raw-id: //depot/cfgperl@3908
Diffstat (limited to 'regcomp.h')
-rw-r--r-- | regcomp.h | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -66,10 +66,10 @@ typedef OP OP_4tree; /* Will be redefined later. */ */ struct regnode_string { - U8 flags; + U8 str_len; U8 type; U16 next_off; - U8 string[1]; + char string[1]; }; struct regnode_1 { @@ -133,6 +133,12 @@ struct regnode_2 { #define OP(p) ((p)->type) #define OPERAND(p) (((struct regnode_string *)p)->string) +#define MASK(p) ((char*)OPERAND(p)) +#define STR_LEN(p) (((struct regnode_string *)p)->str_len) +#define STRING(p) (((struct regnode_string *)p)->string) +#define STR_SZ(l) ((l + sizeof(regnode) - 1) / sizeof(regnode)) +#define NODE_SZ_STR(p) (STR_SZ(STR_LEN(p))+1) + #define NODE_ALIGN(node) #define ARG_LOC(p) (((struct regnode_1 *)p)->arg1) #define ARG1_LOC(p) (((struct regnode_2 *)p)->arg1) |