From 3f1822caed3dca731997c8739c19ee32e5caadc1 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 8 May 2023 14:18:37 -0400 Subject: config: Hoist the assignment outside of BFS_UNINIT() --- src/config.h | 4 ++-- src/parse.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/config.h b/src/config.h index 5f54250..ed3f6ab 100644 --- a/src/config.h +++ b/src/config.h @@ -204,9 +204,9 @@ * Initialize a variable, unless sanitizers would detect uninitialized uses. */ #if __has_feature(memory_sanitizer) -# define BFS_UNINIT(var, value) var = var +# define BFS_UNINIT(var, value) var #else -# define BFS_UNINIT(var, value) var = value +# define BFS_UNINIT(var, value) value #endif #endif // BFS_CONFIG_H diff --git a/src/parse.c b/src/parse.c index 30bf56d..9540e83 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1962,11 +1962,11 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct MODE_PLUS, MODE_MINUS, MODE_EQUALS, - } BFS_UNINIT(op, MODE_EQUALS); + } op = BFS_UNINIT(op, MODE_EQUALS); - mode_t BFS_UNINIT(who, 0); - mode_t BFS_UNINIT(file_change, 0); - mode_t BFS_UNINIT(dir_change, 0); + mode_t who = BFS_UNINIT(who, 0); + mode_t file_change = BFS_UNINIT(file_change, 0); + mode_t dir_change = BFS_UNINIT(dir_change, 0); const char *i = mode; while (true) { -- cgit v1.2.3