This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Use ARRAY_SIZE in i386-tdep.c
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 27 Sep 2003 19:43:06 +0200 (CEST)
- Subject: [PATCH] Use ARRAY_SIZE in i386-tdep.c
I noticed that we have the ARRAY_SIZE macro in libiberty.h. Makes
things more readable IMHO, so I checked this in.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_num_register_names, i386_num_mmx_regs):
Initialize using ARRAY_SIZE.
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.167
diff -u -p -r1.167 i386-tdep.c
--- i386-tdep.c 9 Sep 2003 04:41:32 -0000 1.167
+++ i386-tdep.c 27 Sep 2003 17:39:12 -0000
@@ -67,8 +67,7 @@ static char *i386_register_names[] =
"mxcsr"
};
-static const int i386_num_register_names =
- (sizeof (i386_register_names) / sizeof (*i386_register_names));
+static const int i386_num_register_names = ARRAY_SIZE (i386_register_names);
/* MMX registers. */
@@ -78,8 +77,7 @@ static char *i386_mmx_names[] =
"mm4", "mm5", "mm6", "mm7"
};
-static const int i386_num_mmx_regs =
- (sizeof (i386_mmx_names) / sizeof (i386_mmx_names[0]));
+static const int i386_num_mmx_regs = ARRAY_SIZE (i386_mmx_names);
#define MM0_REGNUM NUM_REGS