Updated soruces in bfd/* to compile cleanly with -Wc++-compat.

* bfd/aoutx.h: Add casts.
        * bfd/archive.c: Add casts.
        * bfd/archive64.c: Add casts.
        * bfd/archures.c: Add casts.
        * bfd/bfd-in2.h: Regenerated.
        * bfd/bfd.c: Add casts. (enum bfd_direction): Move out to top
        level.
        * bfd/bfdio.c: Add casts.
        * bfd/binary.c: Add casts.
        * bfd/cache.c (cache_bseek,cache_bread_1,cache_bwrite): Updated
        parameter to use enum value instead of int.
        * bfd/coffcode.h: Add casts.
        * bfd/coffgen.c: Add casts.
        * bfd/cofflink.c: Add casts.
        * bfd/compress.c: Add casts.
        * bfd/dwarf1.c: Add casts.
        * bfd/dwarf2.c: Add casts. (struct dwarf2_debug): Rename member
        bfd to bfd_ptr. Update code to use new name.
        * bfd/elf-attrs.c: Add casts.
        * bfd/elf-bfd.h (elf_link_virtual_table_entry): Gives name to
        anonymous struct. (union gotplt_union, struct
        elf_link_virtual_table_entry): Move to top level.
        * bfd/elf-eh-frame.c: Add casts.
        * bfd/elf-strtab.c: Add casts.
        * bfd/elf.c: Add casts. (_bfd_elm_make_Section_from_phdr): Change
        argument name from typename to type_name.
        * bfd/elf32-i386.c: Add casts.
        * bfd/elf64-x86-64.c: Add casts.
        * bfd/elfcode.h: Add casts.
        * bfd/elfcore.h: Add casts.
        * bfd/elflink.c: Add casts.
        * bfd/format.c: Add casts.
        * bfd/hash.c: Add casts.
        * bfd/ihex.c: Add casts.
        * bfd/libaout.h (enum aout_subformat, enum aout_magic): Move to
        top level.
        * bfd/libbfd.c: Add casts.
        * bfd/linker.c: Add casts.
        * bfd/merge.c: Add casts.
        * bfd/opncls.c: Add casts.
        * bfd/peXXigen.c: Add casts.
        * bfd/peicode.h: Add casts.
        * bfd/reloc.c: Add casts.
        * bfd/section.c: Add casts.
        * bfd/simple.c: Add casts.
        * bfd/srec.c: Add casts.
        * bfd/stabs.c: Add casts.
        * bfd/syms.c: Add casts.
        * bfd/targets.c: Add casts.
        * bfd/tekhex.c: Add casts.
        * bfd/verilog.c: Add casts.
        * include/bfdlink.h (struct bfd_link_hash_common_entry): Move to
        top level.
This commit is contained in:
Nick Clifton
2009-09-09 21:38:59 +00:00
parent b1dfe69a90
commit a50b1753d4
48 changed files with 713 additions and 574 deletions

View File

@@ -1071,7 +1071,7 @@ handle_COMDAT (bfd * abfd,
amt = sizeof (struct coff_comdat_info);
coff_section_data (abfd, section)->comdat
= bfd_alloc (abfd, amt);
= (struct coff_comdat_info *) bfd_alloc (abfd, amt);
if (coff_section_data (abfd, section)->comdat == NULL)
abort ();
@@ -1079,7 +1079,7 @@ handle_COMDAT (bfd * abfd,
(esym - esymstart) / bfd_coff_symesz (abfd);
amt = strlen (symname) + 1;
newname = bfd_alloc (abfd, amt);
newname = (char *) bfd_alloc (abfd, amt);
if (newname == NULL)
abort ();
@@ -1714,7 +1714,7 @@ coff_new_section_hook (bfd * abfd, asection * section)
@@ The 10 is a guess at a plausible maximum number of aux entries
(but shouldn't be a constant). */
amt = sizeof (combined_entry_type) * 10;
native = bfd_zalloc (abfd, amt);
native = (combined_entry_type *) bfd_zalloc (abfd, amt);
if (native == NULL)
return FALSE;
@@ -3207,7 +3207,7 @@ coff_compute_section_file_positions (bfd * abfd)
/* We allocate an extra cell to simplify the final loop. */
amt = sizeof (struct asection *) * (count + 1);
section_list = bfd_malloc (amt);
section_list = (asection **) bfd_malloc (amt);
if (section_list == NULL)
return FALSE;
@@ -4278,7 +4278,7 @@ coff_write_object_contents (bfd * abfd)
char * buff;
bfd_size_type amount = bfd_coff_filhsz (abfd);
buff = bfd_malloc (amount);
buff = (char *) bfd_malloc (amount);
if (buff == NULL)
return FALSE;
@@ -4298,7 +4298,7 @@ coff_write_object_contents (bfd * abfd)
char * buff;
bfd_size_type amount = bfd_coff_aoutsz (abfd);
buff = bfd_malloc (amount);
buff = (char *) bfd_malloc (amount);
if (buff == NULL)
return FALSE;
@@ -4467,7 +4467,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
BFD_ASSERT (asect->lineno == NULL);
amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent);
lineno_cache = bfd_alloc (abfd, amt);
lineno_cache = (alent *) bfd_alloc (abfd, amt);
if (lineno_cache == NULL)
return FALSE;
@@ -4546,7 +4546,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
alent *n_lineno_cache;
/* Create a table of functions. */
func_table = bfd_alloc (abfd, nbr_func * sizeof (alent *));
func_table = (alent **) bfd_alloc (abfd, nbr_func * sizeof (alent *));
if (func_table != NULL)
{
alent **p = func_table;
@@ -4561,7 +4561,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
/* Create the new sorted table. */
amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent);
n_lineno_cache = bfd_alloc (abfd, amt);
n_lineno_cache = (alent *) bfd_alloc (abfd, amt);
if (n_lineno_cache != NULL)
{
alent *n_cache_ptr = n_lineno_cache;
@@ -4615,13 +4615,13 @@ coff_slurp_symbol_table (bfd * abfd)
/* Allocate enough room for all the symbols in cached form. */
amt = obj_raw_syment_count (abfd);
amt *= sizeof (coff_symbol_type);
cached_area = bfd_alloc (abfd, amt);
cached_area = (coff_symbol_type *) bfd_alloc (abfd, amt);
if (cached_area == NULL)
return FALSE;
amt = obj_raw_syment_count (abfd);
amt *= sizeof (unsigned int);
table_ptr = bfd_alloc (abfd, amt);
table_ptr = (unsigned int *) bfd_alloc (abfd, amt);
if (table_ptr == NULL)
return FALSE;
@@ -5113,7 +5113,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols)
amt = (bfd_size_type) bfd_coff_relsz (abfd) * asect->reloc_count;
native_relocs = (RELOC *) buy_and_read (abfd, asect->rel_filepos, amt);
amt = (bfd_size_type) asect->reloc_count * sizeof (arelent);
reloc_cache = bfd_alloc (abfd, amt);
reloc_cache = (arelent *) bfd_alloc (abfd, amt);
if (reloc_cache == NULL || native_relocs == NULL)
return FALSE;