From 7b5d98877622f2bea24c9dd745dfcf312df31a87 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 9 Jun 2021 14:49:57 -0400 Subject: util: Rename fallthrough to BFS_FALLTHROUGH This avoids shadowing the actually standard name fallthrough. --- eval.c | 4 ++-- parse.c | 18 +++++++++--------- printf.c | 2 +- util.h | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eval.c b/eval.c index 3a5ab12..51b621b 100644 --- a/eval.c +++ b/eval.c @@ -238,10 +238,10 @@ bool eval_time(const struct expr *expr, struct eval_state *state) { switch (expr->time_unit) { case DAYS: diff /= 60*24; - fallthrough; + BFS_FALLTHROUGH; case MINUTES: diff /= 60; - fallthrough; + BFS_FALLTHROUGH; case SECONDS: break; } diff --git a/parse.c b/parse.c index 5983430..83004fb 100644 --- a/parse.c +++ b/parse.c @@ -961,16 +961,16 @@ static struct expr *parse_time(struct parser_state *state, int field, int arg2) switch (*tail) { case 'w': time *= 7; - fallthrough; + BFS_FALLTHROUGH; case 'd': time *= 24; - fallthrough; + BFS_FALLTHROUGH; case 'h': time *= 60; - fallthrough; + BFS_FALLTHROUGH; case 'm': time *= 60; - fallthrough; + BFS_FALLTHROUGH; case 's': break; default: @@ -1873,7 +1873,7 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct case MODE_CLAUSE: who = 0; mstate = MODE_WHO; - fallthrough; + BFS_FALLTHROUGH; case MODE_WHO: switch (*i) { @@ -1900,7 +1900,7 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct case MODE_EQUALS: expr->file_mode &= ~who; expr->dir_mode &= ~who; - fallthrough; + BFS_FALLTHROUGH; case MODE_PLUS: expr->file_mode |= file_change; expr->dir_mode |= dir_change; @@ -1910,7 +1910,7 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct expr->dir_mode &= ~dir_change; break; } - fallthrough; + BFS_FALLTHROUGH; case MODE_ACTION: if (who == 0) { @@ -1992,7 +1992,7 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct break; case 'x': file_change |= who & 0111; - fallthrough; + BFS_FALLTHROUGH; case 'X': dir_change |= who & 0111; break; @@ -2055,7 +2055,7 @@ static struct expr *parse_perm(struct parser_state *state, int field, int arg2) ++mode; break; } - fallthrough; + BFS_FALLTHROUGH; default: expr->mode_cmp = MODE_EXACT; break; diff --git a/printf.c b/printf.c index 26c19a7..b1b0d59 100644 --- a/printf.c +++ b/printf.c @@ -630,7 +630,7 @@ struct bfs_printf *bfs_printf_parse(const struct bfs_ctx *ctx, const char *forma case '0': case '+': must_be_numeric = true; - fallthrough; + BFS_FALLTHROUGH; case ' ': case '-': if (strchr(directive->str, c)) { diff --git a/util.h b/util.h index 07580fc..4542a46 100644 --- a/util.h +++ b/util.h @@ -99,11 +99,11 @@ #endif #if BFS_HAS_C_ATTRIBUTE(fallthrough) -# define fallthrough [[fallthrough]] +# define BFS_FALLTHROUGH [[fallthrough]] #elif BFS_HAS_GNU_ATTRIBUTE(fallthrough) -# define fallthrough __attribute__((fallthrough)) +# define BFS_FALLTHROUGH __attribute__((fallthrough)) #else -# define fallthrough ((void)0) +# define BFS_FALLTHROUGH ((void)0) #endif /** -- cgit v1.2.3