diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
commit | 80b8b39899a09c7516920cda5fd343b3086d4824 (patch) | |
tree | aa9903fd6b64d19c5f640fa302272d85c92b204e /libbb | |
parent | 1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff) | |
download | busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.bz2 busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.zip |
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/speed_table.c | 2 | ||||
-rw-r--r-- | libbb/u_signal_names.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libbb/speed_table.c b/libbb/speed_table.c index 6137b7731..0f0b33d3b 100644 --- a/libbb/speed_table.c +++ b/libbb/speed_table.c | |||
@@ -54,7 +54,7 @@ static const struct speed_map speeds[] = { | |||
54 | #endif | 54 | #endif |
55 | }; | 55 | }; |
56 | 56 | ||
57 | enum { NUM_SPEEDS = (sizeof(speeds) / sizeof(struct speed_map)) }; | 57 | enum { NUM_SPEEDS = ARRAY_SIZE(speeds) }; |
58 | 58 | ||
59 | unsigned int tty_baud_to_value(speed_t speed) | 59 | unsigned int tty_baud_to_value(speed_t speed) |
60 | { | 60 | { |
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c index dc4c0b237..f8eaea76d 100644 --- a/libbb/u_signal_names.c +++ b/libbb/u_signal_names.c | |||
@@ -127,7 +127,7 @@ int get_signum(const char *name) | |||
127 | return i; | 127 | return i; |
128 | if (strncasecmp(name, "SIG", 3) == 0) | 128 | if (strncasecmp(name, "SIG", 3) == 0) |
129 | name += 3; | 129 | name += 3; |
130 | for (i = 0; i < sizeof(signals) / sizeof(signals[0]); i++) | 130 | for (i = 0; i < ARRAY_SIZE(signals); i++) |
131 | if (strcasecmp(name, signals[i]) == 0) | 131 | if (strcasecmp(name, signals[i]) == 0) |
132 | return i; | 132 | return i; |
133 | 133 | ||
@@ -152,7 +152,7 @@ int get_signum(const char *name) | |||
152 | 152 | ||
153 | const char *get_signame(int number) | 153 | const char *get_signame(int number) |
154 | { | 154 | { |
155 | if ((unsigned)number < sizeof(signals) / sizeof(signals[0])) { | 155 | if ((unsigned)number < ARRAY_SIZE(signals)) { |
156 | if (signals[number][0]) /* if it's not an empty str */ | 156 | if (signals[number][0]) /* if it's not an empty str */ |
157 | return signals[number]; | 157 | return signals[number]; |
158 | } | 158 | } |