public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: remove some casts from bucomm.c
@ 2006-03-13  3:55 Ben Elliston
  2006-03-13 10:04 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Elliston @ 2006-03-13  3:55 UTC (permalink / raw)
  To: binutils

This patch changes the type of some local variables from int to enum
bfd_architecture (as they should be) and consequently eliminates some
extraneous casts.  OK for mainline?

2006-03-13  Ben Elliston  <bje@au.ibm.com>

	* bucomm.c (display_target_list): Make local variable `a' to be of
	type enum bfd_architecture.  Thus no need to cast enums to int.
	(display_info_table): Likewise.

Index: bucomm.c
===================================================================
RCS file: /cvs/src/src/binutils/bucomm.c,v
retrieving revision 1.24
diff -u -p -r1.24 bucomm.c
--- bucomm.c    14 Jun 2005 13:26:42 -0000      1.24
+++ bucomm.c    13 Mar 2006 03:44:58 -0000
@@ -189,7 +189,7 @@ display_target_list (void)
     {
       const bfd_target *p = bfd_target_vector[t];
       bfd *abfd = bfd_openw (dummy_name, p->name);
-      int a;
+      enum bfd_architecture a;
 
       printf ("%s\n (header %s, data %s)\n", p->name,
              endian_string (p->header_byteorder),
@@ -213,7 +213,7 @@ display_target_list (void)
          continue;
        }
 
-      for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
+      for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
        if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0))
          printf ("  %s\n",
                  bfd_printable_arch_mach ((enum bfd_architecture) a, 0));
@@ -233,9 +233,9 @@ static int
 display_info_table (int first, int last)
 {
   int t;
-  int a;
   int ret = 1;
   char *dummy_name;
+  enum bfd_architecture a;
 
   /* Print heading of target names.  */
   printf ("\n%*s", (int) LONGEST_ARCH, " ");
@@ -244,7 +244,7 @@ display_info_table (int first, int last)
   putchar ('\n');
 
   dummy_name = make_temp_file (NULL);
-  for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++)
+  for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
     if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0)
       {
        printf ("%*s ", (int) LONGEST_ARCH - 1,

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

* Re: PATCH: remove some casts from bucomm.c
  2006-03-13  3:55 PATCH: remove some casts from bucomm.c Ben Elliston
@ 2006-03-13 10:04 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-03-13 10:04 UTC (permalink / raw)
  To: Ben Elliston; +Cc: binutils

Hi Ben,

> 2006-03-13  Ben Elliston  <bje@au.ibm.com>
> 
> 	* bucomm.c (display_target_list): Make local variable `a' to be of
> 	type enum bfd_architecture.  Thus no need to cast enums to int.
> 	(display_info_table): Likewise.

Approved - please apply.

Cheers
   Nick

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

end of thread, other threads:[~2006-03-13 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-13  3:55 PATCH: remove some casts from bucomm.c Ben Elliston
2006-03-13 10:04 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).