From: Arran Cudbard-Bell Date: Wed, 1 Dec 2021 14:38:42 +0000 (-0600) Subject: Move the xlat flag merge function into xlat_priv.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6632ff6bef0ca61377dbf4e0f44d4ad2c3967e9a;p=thirdparty%2Ffreeradius-server.git Move the xlat flag merge function into xlat_priv.h --- diff --git a/src/lib/unlang/xlat_priv.h b/src/lib/unlang/xlat_priv.h index 8927ca27fe0..bd0dd408b49 100644 --- a/src/lib/unlang/xlat_priv.h +++ b/src/lib/unlang/xlat_priv.h @@ -153,6 +153,22 @@ typedef struct { size_t len; //!< Length of the output string. } xlat_out_t; +/** Merge flags from child to parent + * + * For pass2, if either the parent or child is marked up for pass2, then the parent + * is marked up for pass2. + * + * For needs_async, if both the parent and the child are needs_async, the parent is + * needs_async. + */ +static inline void xlat_flags_merge(xlat_flags_t *parent, xlat_flags_t const *child) +{ + parent->needs_async |= child->needs_async; + parent->needs_resolving |= child->needs_resolving; + parent->pure &= child->pure; /* purity can only be removed, never added */ + parent->pure &= !parent->needs_async; /* things needing async cannot be pure */ +} + /** Walker callback for xlat_walk() * * @param[in] exp being evaluated. diff --git a/src/lib/unlang/xlat_tokenize.c b/src/lib/unlang/xlat_tokenize.c index e586d8aa8d7..a813545ba10 100644 --- a/src/lib/unlang/xlat_tokenize.c +++ b/src/lib/unlang/xlat_tokenize.c @@ -211,22 +211,6 @@ static inline CC_HINT(always_inline) void xlat_exp_set_name_buffer_shallow(xlat_ node->fmt = fmt; } -/** Merge flags from child to parent - * - * For pass2, if either the parent or child is marked up for pass2, then the parent - * is marked up for pass2. - * - * For needs_async, if both the parent and the child are needs_async, the parent is - * needs_async. - */ -static inline CC_HINT(always_inline) void xlat_flags_merge(xlat_flags_t *parent, xlat_flags_t const *child) -{ - parent->needs_async |= child->needs_async; - parent->needs_resolving |= child->needs_resolving; - parent->pure &= child->pure; /* purity can only be removed, never added */ - parent->pure &= !parent->needs_async; /* things needing async cannot be pure */ -} - /** Free a linked list of xlat nodes * * @param[in,out] head to free. Will be set to NULL