From efdc9f6726d94e2805f3fb6a580f62f3b1bcc813 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 18 Feb 2022 22:59:24 -0600 Subject: [PATCH] Cleanup: Use signed type and cast to unsigned. This situation is exposed by a warning from the CLang compiler. The warning makes sense, so the code is changed to a signed type and then cast. The negative value should never make it to the assignment if the preceding if condition properly catches it as intended. --- level_3/controller/c/rule/private-rule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/level_3/controller/c/rule/private-rule.c b/level_3/controller/c/rule/private-rule.c index e7e52db..03cb8e1 100644 --- a/level_3/controller/c/rule/private-rule.c +++ b/level_3/controller/c/rule/private-rule.c @@ -685,7 +685,7 @@ extern "C" { f_status_t controller_rule_action_read_rerun_number(const controller_global_t global, const f_string_t name, controller_cache_t * const cache, f_array_length_t * const index, f_number_unsigned_t * const number) { f_status_t status = F_none; - f_number_unsigned_t parsed = 0; + f_number_signed_t parsed = 0; if (*index + 1 == cache->content_action.used) { status = F_status_set_error(F_valid_not); @@ -744,7 +744,7 @@ extern "C" { return status; } - *number = parsed; + *number = (f_number_unsigned_t) parsed; return F_none; } -- 1.8.3.1