diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/od_bloaty.c | 2 | ||||
-rw-r--r-- | coreutils/stty.c | 4 | ||||
-rw-r--r-- | coreutils/test.c | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 3250856..af5eba9 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c @@ -158,7 +158,7 @@ static const signed char width_bytes[] = { initializer in the width_bytes array. */ struct dummy { int assert_width_bytes_matches_size_spec_decl - [sizeof width_bytes / sizeof width_bytes[0] == N_SIZE_SPECS ? 1 : -1]; + [ARRAY_SIZE(width_bytes) == N_SIZE_SPECS ? 1 : -1]; }; static size_t string_min; diff --git a/coreutils/stty.c b/coreutils/stty.c index e6d054f..0983532 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -319,7 +319,7 @@ static const struct mode_info mode_info[] = { }; enum { - NUM_mode_info = (sizeof(mode_info) / sizeof(mode_info[0])) + NUM_mode_info = ARRAY_SIZE(mode_info) }; /* Control character settings */ @@ -371,7 +371,7 @@ static const struct control_info control_info[] = { }; enum { - NUM_control_info = (sizeof(control_info) / sizeof(control_info[0])) + NUM_control_info = ARRAY_SIZE(control_info) }; /* The width of the screen, for output wrapping */ diff --git a/coreutils/test.c b/coreutils/test.c index 36fb38a..7b87a42 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -146,7 +146,6 @@ static const struct t_op { { ")" , RPAREN , PAREN }, }; -enum { NUM_OPS = sizeof(ops) / sizeof(ops[0]) }; #if ENABLE_FEATURE_TEST_64 typedef int64_t arith_t; @@ -471,7 +470,7 @@ static enum token t_lex(char *s) return op->op_num; } op++; - } while (op < ops + NUM_OPS); + } while (op < ops + ARRAY_SIZE(ops)); return OPERAND; } |