aboutsummaryrefslogtreecommitdiff
path: root/sim/m32c
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/m32c
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/m32c')
-rw-r--r--sim/m32c/ChangeLog5
-rw-r--r--sim/m32c/srcdest.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index 4205507..8f62fc3 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-13 Mike Frysinger <vapier@gentoo.org>
+
+ * srcdest.c: Include libiberty.h.
+ (decode_sd23): Use ARRAY_SIZE.
+
2016-01-10 Mike Frysinger <vapier@gentoo.org>
* config.in, configure: Regenerate.
diff --git a/sim/m32c/srcdest.c b/sim/m32c/srcdest.c
index 8dfe9d0..937779b 100644
--- a/sim/m32c/srcdest.c
+++ b/sim/m32c/srcdest.c
@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdlib.h>
+#include "libiberty.h"
#include "cpu.h"
#include "mem.h"
@@ -354,7 +355,7 @@ decode_sd23 (int bbb, int bb, int bytes, int ind, int add)
srcdest sd;
int code = (bbb << 2) | bb;
- if (code >= sizeof (modes23) / sizeof (modes23[0]))
+ if (code >= ARRAY_SIZE (modes23))
abort ();
if (trace)