From: Kevin Day Date: Sun, 14 Jan 2024 00:01:29 +0000 (-0600) Subject: Update: Add additional parenthesis around status in F_status check macros. X-Git-Tag: 0.6.9~43 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=efa5b2f60b916b9bfaab952b2da6d76de3bf1540;p=fll Update: Add additional parenthesis around status in F_status check macros. This is an extra safety check just in case. --- diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 9bbd258..726e967 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -93,22 +93,22 @@ extern "C" { #define F_status_mask_fine 0x3fff // 0011 1111 1111 1111 #define F_status_mask_code 0xc000 // 1100 0000 0000 0000 - #define F_status_is_error(status) (status & F_status_bit_error) - #define F_status_is_fine(status) ((status & F_status_mask_code) == 0) - #define F_status_is_problem(status) (status & F_status_mask_code) - #define F_status_is_signal(status) ((status & F_status_bit_signal) == F_status_bit_signal) - #define F_status_is_warning(status) (status & F_status_bit_warning) + #define F_status_is_error(status) ((status) & F_status_bit_error) + #define F_status_is_fine(status) (((status) & F_status_mask_code) == 0) + #define F_status_is_problem(status) ((status) & F_status_mask_code) + #define F_status_is_signal(status) (((status) & F_status_bit_signal) == F_status_bit_signal) + #define F_status_is_warning(status) ((status) & F_status_bit_warning) - #define F_status_is_error_not(status) ((status & F_status_bit_error) == 0) - #define F_status_is_fine_not(status) (status & F_status_mask_code) - #define F_status_is_problem_not(status) ((status & F_status_mask_code) == 0) - #define F_status_is_signal_not(status) ((status & F_status_bit_signal) != F_status_bit_signal) - #define F_status_is_warning_not(status) ((status & F_status_bit_warning) == 0) + #define F_status_is_error_not(status) (((status) & F_status_bit_error) == 0) + #define F_status_is_fine_not(status) ((status) & F_status_mask_code) + #define F_status_is_problem_not(status) (((status) & F_status_mask_code) == 0) + #define F_status_is_signal_not(status) (((status) & F_status_bit_signal) != F_status_bit_signal) + #define F_status_is_warning_not(status) (((status) & F_status_bit_warning) == 0) - #define F_status_set_error(status) (status | F_status_bit_error) - #define F_status_set_fine(status) (status & F_status_mask_fine) - #define F_status_set_signal(status) (status | F_status_bit_signal) - #define F_status_set_warning(status) (status | F_status_bit_warning) + #define F_status_set_error(status) ((status) | F_status_bit_error) + #define F_status_set_fine(status) ((status) & F_status_mask_fine) + #define F_status_set_signal(status) ((status) | F_status_bit_signal) + #define F_status_set_warning(status) ((status) | F_status_bit_warning) #define F_status_size_max_d 0x3fff #define F_status_size_max_with_bits_d 0xffff