This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]