summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-06-09 14:49:57 -0400
committerTavian Barnes <tavianator@tavianator.com>2021-06-09 14:55:45 -0400
commit7b5d98877622f2bea24c9dd745dfcf312df31a87 (patch)
treebbb03b5e7663bf0c24aaf8cfc95741d9bf98cb0c
parent41c148c4bf835fca788e6990cb8ea8651bb55927 (diff)
util: Rename fallthrough to BFS_FALLTHROUGH
This avoids shadowing the actually standard name fallthrough.
-rw-r--r--eval.c4
-rw-r--r--parse.c18
-rw-r--r--printf.c2
-rw-r--r--util.h6
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
/**