]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use macro to initialize struct with UNLANG_RESULT_NOT_SET
authorAlan T. DeKok <aland@freeradius.org>
Mon, 14 Jul 2025 20:54:57 +0000 (16:54 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 15 Jul 2025 03:28:43 +0000 (21:28 -0600)
src/lib/unlang/interpret.c
src/lib/unlang/unlang_priv.h
src/lib/unlang/xlat.c
src/lib/unlang/xlat_eval.c
src/lib/unlang/xlat_purify.c

index b8e581304e96e0184caa3b4abb08c8ddbefa367d..d6b39f7dc48ee15d0130f8ba11dcf06417ce78d3 100644 (file)
@@ -1246,10 +1246,8 @@ void *unlang_interpret_stack_alloc(TALLOC_CTX *ctx)
         */
        MEM(stack = talloc_zero_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX, 128));     /* 128 bytes per state */
        stack->frame[0].result_p = &stack->frame[0].section_result;
-       stack->frame[0].scratch_result.rcode = RLM_MODULE_NOT_SET;
-       stack->frame[0].scratch_result.priority = MOD_ACTION_NOT_SET;
-       stack->frame[0].section_result.rcode = RLM_MODULE_NOT_SET;
-       stack->frame[0].section_result.priority = MOD_ACTION_NOT_SET;
+       stack->frame[0].scratch_result = UNLANG_RESULT_NOT_SET;
+       stack->frame[0].section_result = UNLANG_RESULT_NOT_SET;
        stack->frame[0].instruction = &unlang_instruction;      /* The top frame has no instruction, so we use a dummy one */
 
        return stack;
index 8e6c8123b8c991a05f1b60b20d22fb7e49a4363b..fff7cbae5139d7b3bd724a8b421742d702aaf786 100644 (file)
@@ -634,8 +634,7 @@ static inline void frame_state_init(unlang_stack_t *stack, unlang_stack_frame_t
        /*
         *      Reset for each instruction
         */
-       frame->scratch_result.rcode = RLM_MODULE_NOT_SET;
-       frame->scratch_result.priority = MOD_ACTION_NOT_SET;
+       frame->scratch_result = UNLANG_RESULT_NOT_SET;
 
        frame->process = op->interpret;
        frame->signal = op->signal;
index defa3b2bcf4bc9debedfa68b678a378e65a34f76..e8f2e7ae046243448286b16fcdeff74d2e79cd2a 100644 (file)
@@ -728,7 +728,7 @@ xlat_action_t unlang_xlat_yield_to_retry(request_t *request, xlat_func_t resume,
  */
 int unlang_xlat_eval(TALLOC_CTX *ctx, fr_value_box_list_t *out, request_t *request, xlat_exp_head_t const *xlat)
 {
-       unlang_result_t result = { .rcode = RLM_MODULE_NOT_SET, .priority = MOD_ACTION_NOT_SET };
+       unlang_result_t result = UNLANG_RESULT_NOT_SET;
 
        if (xlat->flags.impure_func) {
                fr_strerror_const("Expansion requires async operations");
index fa7935403e8fb55b5c12b7765bc6b7363be5c7a1..1231ad1b1103b2016cb9e2a399a6825facd64e74 100644 (file)
@@ -1629,7 +1629,7 @@ static ssize_t xlat_eval_sync(TALLOC_CTX *ctx, char **out, request_t *request, x
                              xlat_escape_legacy_t escape, void const *escape_ctx)
 {
        fr_value_box_list_t     result;
-       unlang_result_t         unlang_result = { .rcode = RLM_MODULE_NOT_SET, .priority = MOD_ACTION_NOT_SET };
+       unlang_result_t         unlang_result = UNLANG_RESULT_NOT_SET;
        TALLOC_CTX              *pool = talloc_new(NULL);
        rlm_rcode_t             rcode;
        char                    *str;
index 58db33a9fb8b8313e88583e047854ba36e8cd4ea..b3db1592762eb7e28cbfe5be33416222d8a2c5e8 100644 (file)
@@ -66,7 +66,7 @@ int xlat_purify_list(xlat_exp_head_t *head, request_t *request)
 static int xlat_purify_list_internal(xlat_exp_head_t *head, request_t *request, fr_token_t quote)
 {
        int rcode;
-       unlang_result_t result = { .rcode = RLM_MODULE_NOT_SET, .priority = MOD_ACTION_NOT_SET };
+       unlang_result_t result = UNLANG_RESULT_NOT_SET;
        fr_value_box_list_t list;
        xlat_flags_t our_flags;
        xlat_exp_t *node, *next;