This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Use ARRAY_SIZE in m68k_register_name
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Date: Wed, 31 Aug 2005 22:48:24 +0200 (CEST)
- Subject: [commit] Use ARRAY_SIZE in m68k_register_name
The ARI complaind about the || operator at eol. Rather than moving it
to the next line I just converted the code to use ARRAY_SIZE ;-).
Committed as obvious,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* m68k-tdep.c (m68k_register_name): Use ARRAY_SIZE.
Index: m68k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68k-tdep.c,v
retrieving revision 1.103
diff -u -p -r1.103 m68k-tdep.c
--- m68k-tdep.c 17 Aug 2005 18:34:17 -0000 1.103
+++ m68k-tdep.c 31 Aug 2005 20:46:23 -0000
@@ -122,8 +122,7 @@ m68k_register_name (int regnum)
"fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags"
};
- if (regnum < 0 ||
- regnum >= sizeof (register_names) / sizeof (register_names[0]))
+ if (regnum < 0 || regnum >= ARRAY_SIZE (register_names))
internal_error (__FILE__, __LINE__,
_("m68k_register_name: illegal register number %d"), regnum);
else