public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: more tidy-ups
@ 2006-05-02  7:50 Ben Elliston
  2006-05-02  9:35 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Elliston @ 2006-05-02  7:50 UTC (permalink / raw)
  To: binutils

More trivial patches from my local tree.  I think these are all
completely obvious, but again, an inspection from someone else would
not hurt!

Tested with an all-targets build.

Ben

2006-05-02  Ben Elliston  <bje@au.ibm.com>

        * archive.c (bfd_generic_archive_p): Remove unused local variable
        `fail'.
        * dwarf2.c (decode_line_info): Remove unused local variable
        `basic_block'.
        * elfcode.h (elf_slurp_reloc_table_from_section): Remove unsed
        local varibale `s'.
        * tekhex.c (tekhex_write_object_contents): Remove unused local
        variable `bytes_written'.
        * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
        variable `r_addend'.
        * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
        * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
        (_bfd_ns32k_relocate_contents): Remove break after return.
        * elf.c (bfd_section_from_shdr): Remove breaks after returns.

Index: archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.43
diff -u -p -r1.43 archive.c
--- archive.c	5 Oct 2005 21:24:23 -0000	1.43
+++ archive.c	2 May 2006 06:43:11 -0000
@@ -666,10 +666,7 @@ bfd_generic_archive_p (bfd *abfd)
       first = bfd_openr_next_archived_file (abfd, NULL);
       if (first != NULL)
 	{
-	  bfd_boolean fail;
-
 	  first->target_defaulted = FALSE;
-	  fail = FALSE;
 	  if (bfd_check_format (first, bfd_object)
 	      && first->xvec != abfd->xvec)
 	    {
Index: dwarf2.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf2.c,v
retrieving revision 1.88
diff -u -p -r1.88 dwarf2.c
--- dwarf2.c	2 May 2006 01:41:20 -0000	1.88
+++ dwarf2.c	2 May 2006 06:43:12 -0000
@@ -1117,7 +1117,6 @@ decode_line_info (struct comp_unit *unit
       unsigned int line = 1;
       unsigned int column = 0;
       int is_stmt = lh.default_is_stmt;
-      int basic_block = 0;
       int end_sequence = 0;
       /* eraxxon@alumni.rice.edu: Against the DWARF2 specs, some
 	 compilers generate address sequences that are wildly out of
@@ -1142,7 +1141,6 @@ decode_line_info (struct comp_unit *unit
 	      line += lh.line_base + (adj_opcode % lh.line_range);
 	      /* Append row to matrix using current values.  */
 	      add_line_info (table, address, filename, line, column, 0);
-	      basic_block = 1;
 	      if (address < low_pc)
 		low_pc = address;
 	      if (address > high_pc)
@@ -1214,7 +1212,6 @@ decode_line_info (struct comp_unit *unit
 	      break;
 	    case DW_LNS_copy:
 	      add_line_info (table, address, filename, line, column, 0);
-	      basic_block = 0;
 	      if (address < low_pc)
 		low_pc = address;
 	      if (address > high_pc)
@@ -1250,7 +1247,6 @@ decode_line_info (struct comp_unit *unit
 	      is_stmt = (!is_stmt);
 	      break;
 	    case DW_LNS_set_basic_block:
-	      basic_block = 1;
 	      break;
 	    case DW_LNS_const_add_pc:
 	      address += lh.minimum_instruction_length
Index: elfcode.h
===================================================================
RCS file: /cvs/src/src/bfd/elfcode.h,v
retrieving revision 1.75
diff -u -p -r1.75 elfcode.h
--- elfcode.h	2 May 2006 01:41:20 -0000	1.75
+++ elfcode.h	2 May 2006 06:43:12 -0000
@@ -1350,10 +1350,8 @@ elf_slurp_reloc_table_from_section (bfd 
 	}
       else
 	{
-	  asymbol **ps, *s;
-
+	  asymbol **ps;
 	  ps = symbols + ELF_R_SYM (rela.r_info) - 1;
-	  s = *ps;
 
 	  relent->sym_ptr_ptr = ps;
 	}
Index: tekhex.c
===================================================================
RCS file: /cvs/src/src/bfd/tekhex.c,v
retrieving revision 1.27
diff -u -p -r1.27 tekhex.c
--- tekhex.c	27 Apr 2006 05:57:09 -0000	1.27
+++ tekhex.c	2 May 2006 06:43:13 -0000
@@ -751,7 +751,6 @@ out (bfd *abfd, int type, char *start, c
 static bfd_boolean
 tekhex_write_object_contents (bfd *abfd)
 {
-  int bytes_written;
   char buffer[100];
   asymbol **p;
   asection *s;
@@ -759,8 +758,6 @@ tekhex_write_object_contents (bfd *abfd)
 
   tekhex_init ();
 
-  bytes_written = 0;
-
   /* And the raw data.  */
   for (d = abfd->tdata.tekhex_data->data;
        d != NULL;
Index: aout-ns32k.c
===================================================================
RCS file: /cvs/src/src/bfd/aout-ns32k.c,v
retrieving revision 1.17
diff -u -p -r1.17 aout-ns32k.c
--- aout-ns32k.c	4 May 2005 15:52:59 -0000	1.17
+++ aout-ns32k.c	2 May 2006 06:43:13 -0000
@@ -274,11 +274,8 @@ MY_swap_std_reloc_out (bfd *abfd,
   int r_index;
   asymbol *sym = *(g->sym_ptr_ptr);
   int r_extern;
-  unsigned int r_addend;
   asection *output_section = sym->section->output_section;
 
-  r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
-
   /* Name was clobbered by aout_write_syms to be symbol index.  */
 
   /* If this relocation is relative to a symbol then set the
@@ -341,7 +338,6 @@ _bfd_ns32k_relocate_contents (reloc_howt
     case 2:
       return _bfd_relocate_contents (howto, input_bfd, relocation,
 				    location);
-      break;
     default:
       return bfd_reloc_notsupported;
     }
Index: elf32-dlx.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-dlx.c,v
retrieving revision 1.16
diff -u -p -r1.16 elf32-dlx.c
--- elf32-dlx.c	1 Jul 2005 11:16:29 -0000	1.16
+++ elf32-dlx.c	2 May 2006 06:43:13 -0000
@@ -512,21 +512,15 @@ dlx_rtype_to_howto (unsigned int r_type)
     {
     case R_DLX_RELOC_16_PCREL:
       return & elf_dlx_gnu_rel16_s2;
-      break;
     case R_DLX_RELOC_26_PCREL:
       return & elf_dlx_gnu_rel26_s2;
-      break;
     case R_DLX_RELOC_16_HI:
       return & elf_dlx_reloc_16_hi;
-      break;
     case R_DLX_RELOC_16_LO:
       return & elf_dlx_reloc_16_lo;
-      break;
-
     default:
       BFD_ASSERT (r_type < (unsigned int) R_DLX_max);
       return & dlx_elf_howto_table[r_type];
-      break;
     }
 }
 
Index: elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.165
diff -u -p -r1.165 elfxx-mips.c
--- elfxx-mips.c	27 Mar 2006 11:30:53 -0000	1.165
+++ elfxx-mips.c	2 May 2006 06:43:16 -0000
@@ -4955,39 +4955,30 @@ _bfd_elf_mips_mach (flagword flags)
 	default:
 	case E_MIPS_ARCH_1:
 	  return bfd_mach_mips3000;
-	  break;
 
 	case E_MIPS_ARCH_2:
 	  return bfd_mach_mips6000;
-	  break;
 
 	case E_MIPS_ARCH_3:
 	  return bfd_mach_mips4000;
-	  break;
 
 	case E_MIPS_ARCH_4:
 	  return bfd_mach_mips8000;
-	  break;
 
 	case E_MIPS_ARCH_5:
 	  return bfd_mach_mips5;
-	  break;
 
 	case E_MIPS_ARCH_32:
 	  return bfd_mach_mipsisa32;
-	  break;
 
 	case E_MIPS_ARCH_64:
 	  return bfd_mach_mipsisa64;
-	  break;
 
 	case E_MIPS_ARCH_32R2:
 	  return bfd_mach_mipsisa32r2;
-	  break;
 
 	case E_MIPS_ARCH_64R2:
 	  return bfd_mach_mipsisa64r2;
-	  break;
 	}
     }
 
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.333
diff -u -p -r1.333 elf.c
--- elf.c	26 Apr 2006 13:32:26 -0000	1.333
+++ elf.c	2 May 2006 06:43:18 -0000
@@ -2113,13 +2113,11 @@ bfd_section_from_shdr (bfd *abfd, unsign
       elf_dynversym (abfd) = shindex;
       elf_tdata (abfd)->dynversym_hdr = *hdr;
       return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
-      break;
 
     case SHT_GNU_verneed:
       elf_dynverref (abfd) = shindex;
       elf_tdata (abfd)->dynverref_hdr = *hdr;
       return _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex);
-      break;
 
     case SHT_SHLIB:
       return TRUE;

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

* Re: PATCH: more tidy-ups
  2006-05-02  7:50 PATCH: more tidy-ups Ben Elliston
@ 2006-05-02  9:35 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-05-02  9:35 UTC (permalink / raw)
  To: Ben Elliston; +Cc: binutils

Hi Ben,

> More trivial patches from my local tree.  I think these are all
> completely obvious, but again, an inspection from someone else would
> not hurt!

These are fine.

> 2006-05-02  Ben Elliston  <bje@au.ibm.com>
> 
>         * archive.c (bfd_generic_archive_p): Remove unused local variable
>         `fail'.
>         * dwarf2.c (decode_line_info): Remove unused local variable
>         `basic_block'.
>         * elfcode.h (elf_slurp_reloc_table_from_section): Remove unsed
>         local varibale `s'.
>         * tekhex.c (tekhex_write_object_contents): Remove unused local
>         variable `bytes_written'.
>         * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
>         variable `r_addend'.
>         * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
>         * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
>         (_bfd_ns32k_relocate_contents): Remove break after return.
>         * elf.c (bfd_section_from_shdr): Remove breaks after returns.

Approved - please apply.

Cheers
   Nick

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

end of thread, other threads:[~2006-05-02  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-02  7:50 PATCH: more tidy-ups Ben Elliston
2006-05-02  9:35 ` 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).