Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Use ARRAY_SIZE in i386-tdep.c
Date: Sat, 27 Sep 2003 17:43:00 -0000	[thread overview]
Message-ID: <200309271743.h8RHh6Ov008233@elgar.kettenis.dyndns.org> (raw)

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
 


             reply	other threads:[~2003-09-27 17:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-27 17:43 Mark Kettenis [this message]
2003-09-27 18:38 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200309271743.h8RHh6Ov008233@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox