From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10392 invoked by alias); 27 Sep 2003 17:43:10 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9985 invoked from network); 27 Sep 2003 17:43:08 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 27 Sep 2003 17:43:08 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id h8RHh6FU000273 for ; Sat, 27 Sep 2003 19:43:06 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id h8RHh6oL008236 for ; Sat, 27 Sep 2003 19:43:06 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id h8RHh6Ov008233; Sat, 27 Sep 2003 19:43:06 +0200 (CEST) Date: Sat, 27 Sep 2003 17:43:00 -0000 Message-Id: <200309271743.h8RHh6Ov008233@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] Use ARRAY_SIZE in i386-tdep.c X-SW-Source: 2003-09/txt/msg00601.txt.bz2 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 * 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