diff options
author | Mike Frysinger <vapier@gentoo.org> | 2017-02-13 00:12:35 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2017-02-13 01:26:21 -0500 |
commit | 13a590ca65f744c8fa55d6e0748cb12f443493f0 (patch) | |
tree | 0aaec23ac3d6682a00d7af03dbef8e790c47b681 /sim/sh64 | |
parent | b1499fc214c2877ba76d7dffd4c41e33f3ec37f6 (diff) | |
download | gdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.zip gdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.tar.gz gdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.tar.bz2 |
sim: use ARRAY_SIZE instead of ad-hoc sizeof calculations
Diffstat (limited to 'sim/sh64')
-rw-r--r-- | sim/sh64/ChangeLog | 5 | ||||
-rw-r--r-- | sim/sh64/decode-compact.c | 2 | ||||
-rw-r--r-- | sim/sh64/decode-media.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/sim/sh64/ChangeLog b/sim/sh64/ChangeLog index 7627e21..c0d31dd 100644 --- a/sim/sh64/ChangeLog +++ b/sim/sh64/ChangeLog @@ -1,3 +1,8 @@ +2017-02-13 Mike Frysinger <vapier@gentoo.org> + + * decode-compact.c (sh64_compact_init_idesc_table): Use ARRAY_SIZE. + * decode-media.c (sh64_media_init_idesc_table): Likewise. + 2016-01-10 Mike Frysinger <vapier@gentoo.org> * config.in, configure: Regenerate. diff --git a/sim/sh64/decode-compact.c b/sim/sh64/decode-compact.c index 3b23166..0eeabab 100644 --- a/sim/sh64/decode-compact.c +++ b/sim/sh64/decode-compact.c @@ -292,7 +292,7 @@ sh64_compact_init_idesc_table (SIM_CPU *cpu) init_idesc (cpu, id, t); /* Now fill in the values for the chosen cpu. */ - for (t = sh64_compact_insn_sem, tend = t + sizeof (sh64_compact_insn_sem) / sizeof (*t); + for (t = sh64_compact_insn_sem, tend = t + ARRAY_SIZE (sh64_compact_insn_sem); t != tend; ++t) { init_idesc (cpu, & table[t->index], t); diff --git a/sim/sh64/decode-media.c b/sim/sh64/decode-media.c index 40aa983..74fb83d 100644 --- a/sim/sh64/decode-media.c +++ b/sim/sh64/decode-media.c @@ -306,7 +306,7 @@ sh64_media_init_idesc_table (SIM_CPU *cpu) init_idesc (cpu, id, t); /* Now fill in the values for the chosen cpu. */ - for (t = sh64_media_insn_sem, tend = t + sizeof (sh64_media_insn_sem) / sizeof (*t); + for (t = sh64_media_insn_sem, tend = t + ARRAY_SIZE (sh64_media_insn_sem); t != tend; ++t) { init_idesc (cpu, & table[t->index], t); |