]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
now that we don't mangle things, put these into a union
authorAlan T. DeKok <aland@freeradius.org>
Mon, 22 Nov 2021 20:13:35 +0000 (15:13 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 22 Nov 2021 20:13:35 +0000 (15:13 -0500)
because there's no reason to have all of the field available
for all of the xlat types

src/lib/unlang/xlat_priv.h

index 19e7b3a6d4da4a61d19dc2c9cc1b69910b4ce75c..4c12f40e354ca79720a6c3b5b3f548b6ef210bb1 100644 (file)
@@ -120,21 +120,24 @@ struct xlat_exp {
        xlat_exp_t      *next;          //!< Next in the list.
 
        xlat_exp_t      *child;         //!< Nested expansion, i.e. arguments for an xlat function.
-       xlat_exp_t      *alternate;     //!< Alternative expansion if this expansion produced no values.
 
-       /** An attribute reference
-        *
-        * May be an attribute to expand, or provide context for a call.
-        */
-       tmpl_t          *attr;
-
-       /** A capture group, i.e. for %{1} and friends
-        */
-       int             regex_index;
-
-       /** An xlat function call
-        */
-       xlat_call_t     call;
+       union {
+               xlat_exp_t      *alternate;     //!< Alternative expansion if this expansion produced no values.
+
+               /** An attribute reference
+                *
+                * May be an attribute to expand, or provide context for a call.
+                */
+               tmpl_t          *attr;
+
+               /** A capture group, i.e. for %{1} and friends
+                */
+               int             regex_index;
+
+               /** An xlat function call
+                */
+               xlat_call_t     call;
+       };
 };
 
 typedef struct {