aboutsummaryrefslogtreecommitdiff
path: root/sim/rx
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/rx
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/rx')
-rw-r--r--sim/rx/ChangeLog5
-rw-r--r--sim/rx/rx.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
index 39de491..d29e429 100644
--- a/sim/rx/ChangeLog
+++ b/sim/rx/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-13 Mike Frysinger <vapier@gentoo.org>
+
+ * rx.c: Include libiberty.h.
+ (N_RXO, N_RXT): Use ARRAY_SIZE.
+
2016-07-27 Alan Modra <amodra@gmail.com>
* load.c: Don't include libbfd.h.
diff --git a/sim/rx/rx.c b/sim/rx/rx.c
index 82b92b5..28dd2b6 100644
--- a/sim/rx/rx.c
+++ b/sim/rx/rx.c
@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdlib.h>
#include <string.h>
#include <signal.h>
+#include "libiberty.h"
#include "opcode/rx.h"
#include "cpu.h"
@@ -151,8 +152,8 @@ static const char * optype_names[] = {
"RbRi" /* [Rb + scale * Ri] */
};
-#define N_RXO (sizeof(id_names)/sizeof(id_names[0]))
-#define N_RXT (sizeof(optype_names)/sizeof(optype_names[0]))
+#define N_RXO ARRAY_SIZE (id_names)
+#define N_RXT ARRAY_SIZE (optype_names)
#define N_MAP 90
static unsigned long long benchmark_start_cycle;