aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc/options.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2017-02-13 00:12:35 -0500
committerMike Frysinger <vapier@gentoo.org>2017-02-13 01:26:21 -0500
commit13a590ca65f744c8fa55d6e0748cb12f443493f0 (patch)
tree0aaec23ac3d6682a00d7af03dbef8e790c47b681 /sim/ppc/options.c
parentb1499fc214c2877ba76d7dffd4c41e33f3ec37f6 (diff)
downloadgdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.zip
gdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.tar.gz
gdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.tar.bz2
sim: use ARRAY_SIZE instead of ad-hoc sizeof calculations
Diffstat (limited to 'sim/ppc/options.c')
-rw-r--r--sim/ppc/options.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sim/ppc/options.c b/sim/ppc/options.c
index 169378e..ddb492f 100644
--- a/sim/ppc/options.c
+++ b/sim/ppc/options.c
@@ -216,7 +216,7 @@ print_options (void)
int max_len = 0;
int cols;
- for (i = 0; i < sizeof (defines) / sizeof (defines[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE (defines); i++) {
int len = strlen (defines[i]);
if (len > max_len)
max_len = len;
@@ -227,10 +227,10 @@ print_options (void)
cols = 1;
printf_filtered ("\n#defines:");
- for (i = 0; i < sizeof (defines) / sizeof (defines[0]); i++) {
+ for (i = 0; i < ARRAY_SIZE (defines); i++) {
const char *const prefix = ((i % cols) == 0) ? "\n" : "";
printf_filtered ("%s %s%*s", prefix, defines[i],
- (((i == (sizeof (defines) / sizeof (defines[0])) - 1)
+ (((i == ARRAY_SIZE (defines) - 1)
|| (((i + 1) % cols) == 0))
? 0
: max_len + 4 - strlen (defines[i])),