summaryrefslogtreecommitdiff
path: root/sim/m32r
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/m32r
parentb1499fc214c2877ba76d7dffd4c41e33f3ec37f6 (diff)
downloadbinutils-gdb-13a590ca65f744c8fa55d6e0748cb12f443493f0.tar.gz
sim: use ARRAY_SIZE instead of ad-hoc sizeof calculations
Diffstat (limited to 'sim/m32r')
-rw-r--r--sim/m32r/ChangeLog6
-rw-r--r--sim/m32r/decode.c2
-rw-r--r--sim/m32r/decode2.c2
-rw-r--r--sim/m32r/decodex.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index a0be81e2964..6a9a85c6650 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-13 Mike Frysinger <vapier@gentoo.org>
+
+ * decode.c (m32rbf_init_idesc_table): Use ARRAY_SIZE.
+ * decode2.c (m32r2f_init_idesc_table): Likewise.
+ * decodex.c (m32rxf_init_idesc_table): Likewise.
+
2016-01-10 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
diff --git a/sim/m32r/decode.c b/sim/m32r/decode.c
index 9f7998e0a45..70494bccef8 100644
--- a/sim/m32r/decode.c
+++ b/sim/m32r/decode.c
@@ -202,7 +202,7 @@ m32rbf_init_idesc_table (SIM_CPU *cpu)
init_idesc (cpu, id, t);
/* Now fill in the values for the chosen cpu. */
- for (t = m32rbf_insn_sem, tend = t + sizeof (m32rbf_insn_sem) / sizeof (*t);
+ for (t = m32rbf_insn_sem, tend = t + ARRAY_SIZE (m32rbf_insn_sem);
t != tend; ++t)
{
init_idesc (cpu, & table[t->index], t);
diff --git a/sim/m32r/decode2.c b/sim/m32r/decode2.c
index a8833dbb8f0..f138d7cb21d 100644
--- a/sim/m32r/decode2.c
+++ b/sim/m32r/decode2.c
@@ -235,7 +235,7 @@ m32r2f_init_idesc_table (SIM_CPU *cpu)
init_idesc (cpu, id, t);
/* Now fill in the values for the chosen cpu. */
- for (t = m32r2f_insn_sem, tend = t + sizeof (m32r2f_insn_sem) / sizeof (*t);
+ for (t = m32r2f_insn_sem, tend = t + ARRAY_SIZE (m32r2f_insn_sem);
t != tend; ++t)
{
init_idesc (cpu, & table[t->index], t);
diff --git a/sim/m32r/decodex.c b/sim/m32r/decodex.c
index 4274b523ec5..0b695cc28ce 100644
--- a/sim/m32r/decodex.c
+++ b/sim/m32r/decodex.c
@@ -228,7 +228,7 @@ m32rxf_init_idesc_table (SIM_CPU *cpu)
init_idesc (cpu, id, t);
/* Now fill in the values for the chosen cpu. */
- for (t = m32rxf_insn_sem, tend = t + sizeof (m32rxf_insn_sem) / sizeof (*t);
+ for (t = m32rxf_insn_sem, tend = t + ARRAY_SIZE (m32rxf_insn_sem);
t != tend; ++t)
{
init_idesc (cpu, & table[t->index], t);