This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: exec_file_hook_count data-type
- From: Michael Snyder <msnyder at redhat dot com>
- To: Daniel Lucq <daniel at lucq dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 24 Feb 2004 14:32:49 -0800
- Subject: Re: exec_file_hook_count data-type
- Organization: Red Hat, Inc.
- References: <Pine.BSO.4.58.0402221947400.5542@snorlax.internal.custodix.com>
Daniel Lucq wrote:
Hi all,
I suppose exec_file_hook_count in corefile.c should always be >= 0, so why
not make it an unsigned instead of an int? (yeah, I suppose this is a
minor issue, but still :-)).
Regards,
Daniel Lucq
Looks good. I won't demand that you use "unsigned int", but I'd
like it. I don't think it's covered by the coding standard, but
it seems to be the norm within gdb code (with exceptions), and in
my old age I find consistency comforting. ;-)
--- corefile.c.orig Sun Feb 22 19:44:17 2004
+++ corefile.c Sun Feb 22 19:45:18 2004
@@ -53,7 +53,7 @@
hook_type exec_file_display_hook; /* the original hook */
static hook_type *exec_file_extra_hooks; /* array of additional hooks */
-static int exec_file_hook_count = 0; /* size of array */
+static unsigned exec_file_hook_count = 0; /* size of array */
/* Binary file diddling handle for the core file. */
@@ -86,7 +86,7 @@
static void
call_extra_exec_file_hooks (char *filename)
{
- int i;
+ unsigned i;
for (i = 0; i < exec_file_hook_count; i++)
(*exec_file_extra_hooks[i]) (filename);