Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Use ARRAY_SIZE in i386-tdep.c
@ 2003-09-27 17:43 Mark Kettenis
  2003-09-27 18:38 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Kettenis @ 2003-09-27 17:43 UTC (permalink / raw)
  To: gdb-patches

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
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-27 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-27 17:43 [PATCH] Use ARRAY_SIZE in i386-tdep.c Mark Kettenis
2003-09-27 18:38 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox