From: Alan T. DeKok Date: Fri, 15 Sep 2017 13:32:50 +0000 (-0400) Subject: shrink unlang_group_t slightly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d97df05673d2fb1eb6a00555e196ac3cea1e64b2;p=thirdparty%2Ffreeradius-server.git shrink unlang_group_t slightly with anonymous struct anonymous union --- diff --git a/src/include/interpreter.h b/src/include/interpreter.h index 2979fc02d08..96b9814f4db 100644 --- a/src/include/interpreter.h +++ b/src/include/interpreter.h @@ -131,16 +131,27 @@ typedef struct { CONF_SECTION *cs; int num_children; - vp_tmpl_t *vpt; //!< #UNLANG_TYPE_SWITCH, #UNLANG_TYPE_MAP. - - vp_map_t *map; //!< #UNLANG_TYPE_UPDATE, #UNLANG_TYPE_MAP. + /* + * Hackity-hack. We should probably just have a common + * group header, and then have type-specific structures. + */ union { + struct { + vp_tmpl_t *vpt; //!< #UNLANG_TYPE_SWITCH, #UNLANG_TYPE_MAP, #UNLANG_TYPE_CALL + + union { + struct { + vp_map_t *map; //!< #UNLANG_TYPE_UPDATE, #UNLANG_TYPE_MAP. + map_proc_inst_t *proc_inst; //!< Instantiation data for #UNLANG_TYPE_MAP. + }; + struct { + void const *process; //!< #UNLANG_TYPE_CALL + CONF_SECTION *server_cs; //!< #UNLANG_TYPE_CALL + }; + }; + }; fr_cond_t *cond; //!< #UNLANG_TYPE_IF, #UNLANG_TYPE_ELSIF. - - map_proc_inst_t *proc_inst; //!< Instantiation data for #UNLANG_TYPE_MAP. - void const *process; //!< UNLANG_TYPE_CALL }; - CONF_SECTION *server_cs; //!< UNLANG_TYPE_CALL } unlang_group_t; /** A call to a module method