summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorLukas Mai <lukasmai.403@gmail.com>2023-03-14 10:21:26 +0100
committerYves Orton <demerphq@gmail.com>2023-03-14 20:05:29 +0800
commite34ab2f7832c24c8bb6f4ae13126df008b6e9f42 (patch)
tree9cc9be293eaffa4b24075e5f02316ad97c1497fe /regcomp.h
parentb58c18a31b5fadf73cf761338de5b4b79c4c6805 (diff)
downloadperl-e34ab2f7832c24c8bb6f4ae13126df008b6e9f42.tar.gz
regcomp.h: give names to anonymous union members
Anonymous unions/structs are a C11 feature (previously a GNU extension) and not available in C90 or C99. Fixes #20932.
Diffstat (limited to 'regcomp.h')
-rw-r--r--regcomp.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/regcomp.h b/regcomp.h
index ca670490ec..1b380fccba 100644
--- a/regcomp.h
+++ b/regcomp.h
@@ -185,8 +185,8 @@ struct regnode_anyofhs { /* Constructed this way to keep the string aligned. */
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
char string[1];
};
@@ -204,8 +204,8 @@ struct regnode_1 {
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
};
/* Node whose argument is 'SV *'. This needs to be used very carefully in
@@ -244,16 +244,16 @@ struct regnode_2 {
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
union {
U32 arg2u;
I32 arg2i;
struct {
U16 arg2a;
U16 arg2b;
- };
- };
+ } hi_lo;
+ } arg2;
};
/* "Three Node" - similar to a regnode_2 but with space for an additional
@@ -274,24 +274,24 @@ struct regnode_3 {
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
union {
I32 arg2i;
U32 arg2u;
struct {
U16 arg2a;
U16 arg2b;
- };
- };
+ } hi_lo;
+ } arg2;
union {
struct {
U16 arg3a;
U16 arg3b;
- };
+ } hi_lo;
I32 arg3i;
U32 arg3u;
- };
+ } arg3;
};
#define REGNODE_BBM_BITMAP_LEN \
@@ -332,8 +332,8 @@ struct regnode_charclass {
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
char bitmap[ANYOF_BITMAP_SIZE]; /* only compile-time */
};
@@ -348,8 +348,8 @@ struct regnode_charclass_posixl {
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
char bitmap[ANYOF_BITMAP_SIZE]; /* both compile-time ... */
U32 classflags; /* and run-time */
};
@@ -377,8 +377,8 @@ struct regnode_ssc {
struct {
U16 arg1a;
U16 arg1b;
- };
- };
+ } hi_lo;
+ } arg1;
char bitmap[ANYOF_BITMAP_SIZE]; /* both compile-time ... */
U32 classflags; /* ... and run-time */
@@ -553,18 +553,18 @@ struct regnode_ssc {
#define NODE_ALIGN(node)
#define ARGp_BYTES_LOC(p) (((struct regnode_p *)p)->arg1_sv_ptr_bytes)
-#define ARG1u_LOC(p) (((struct regnode_1 *)p)->arg1u)
-#define ARG1i_LOC(p) (((struct regnode_1 *)p)->arg1i)
-#define ARG1a_LOC(p) (((struct regnode_1 *)p)->arg1a)
-#define ARG1b_LOC(p) (((struct regnode_1 *)p)->arg1b)
-#define ARG2u_LOC(p) (((struct regnode_2 *)p)->arg2u)
-#define ARG2i_LOC(p) (((struct regnode_2 *)p)->arg2i)
-#define ARG2a_LOC(p) (((struct regnode_2 *)p)->arg2a)
-#define ARG2b_LOC(p) (((struct regnode_2 *)p)->arg2b)
-#define ARG3u_LOC(p) (((struct regnode_3 *)p)->arg3u)
-#define ARG3i_LOC(p) (((struct regnode_3 *)p)->arg3i)
-#define ARG3a_LOC(p) (((struct regnode_3 *)p)->arg3a)
-#define ARG3b_LOC(p) (((struct regnode_3 *)p)->arg3b)
+#define ARG1u_LOC(p) (((struct regnode_1 *)p)->arg1.arg1u)
+#define ARG1i_LOC(p) (((struct regnode_1 *)p)->arg1.arg1i)
+#define ARG1a_LOC(p) (((struct regnode_1 *)p)->arg1.hi_lo.arg1a)
+#define ARG1b_LOC(p) (((struct regnode_1 *)p)->arg1.hi_lo.arg1b)
+#define ARG2u_LOC(p) (((struct regnode_2 *)p)->arg2.arg2u)
+#define ARG2i_LOC(p) (((struct regnode_2 *)p)->arg2.arg2i)
+#define ARG2a_LOC(p) (((struct regnode_2 *)p)->arg2.hi_lo.arg2a)
+#define ARG2b_LOC(p) (((struct regnode_2 *)p)->arg2.hi_lo.arg2b)
+#define ARG3u_LOC(p) (((struct regnode_3 *)p)->arg3.arg3u)
+#define ARG3i_LOC(p) (((struct regnode_3 *)p)->arg3.arg3i)
+#define ARG3a_LOC(p) (((struct regnode_3 *)p)->arg3.hi_lo.arg3a)
+#define ARG3b_LOC(p) (((struct regnode_3 *)p)->arg3.hi_lo.arg3b)
/* These should no longer be used directly in most cases. Please use
* the REGNODE_AFTER() macros instead. */