This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] rs6000: Use generic routines instead of hard-coded casts


Hi,

coff-rs6000.c and coff64-rs6000.c uses casts of bfd_true/bfd_false instead of the generic macros written
for this intent.  I think this is not good style and doesn't add any value.  This patch replaces these casts
with the macros.

Tested as a cross on x86-linux, no regressions.

Tristan.

bfd/
2009-11-17  Tristan Gingold  <gingold@adacore.com>

	* coff-rs6000.c (rs6000coff_vec): Use generic routines instead of
	hard-coded casts.
	(pmac_xcoff_vec): Ditto.
	* coff64-rs6000.c (rs6000coff64_vec): Ditto.
	(aix5coff64_vec): Ditto.


diff -c -p -r1.91 coff-rs6000.c
*** coff-rs6000.c	5 Sep 2009 07:56:21 -0000	1.91
--- coff-rs6000.c	17 Nov 2009 11:12:46 -0000
*************** const bfd_target rs6000coff_vec =
*** 4171,4183 ****
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
      _bfd_generic_init_private_section_data,
!     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
!     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
  
      /* Core */
      coff_core_file_failing_command,
--- 4171,4183 ----
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     _bfd_generic_bfd_merge_private_bfd_data,
      _bfd_generic_init_private_section_data,
!     _bfd_generic_bfd_copy_private_section_data,
!     _bfd_generic_bfd_copy_private_symbol_data,
!     _bfd_generic_bfd_copy_private_header_data,
!     _bfd_generic_bfd_set_private_flags,
!     _bfd_generic_bfd_print_private_bfd_data,
  
      /* Core */
      coff_core_file_failing_command,
*************** const bfd_target rs6000coff_vec =
*** 4186,4193 ****
  
      /* Archive */
      _bfd_xcoff_slurp_armap,
!     bfd_false,
!     ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false),
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
--- 4186,4193 ----
  
      /* Archive */
      _bfd_xcoff_slurp_armap,
!     _bfd_noarchive_slurp_extended_name_table,
!     _bfd_noarchive_construct_extended_name_table,
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
*************** const bfd_target pmac_xcoff_vec =
*** 4424,4436 ****
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
      _bfd_generic_init_private_section_data,
!     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
!     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
  
      /* Core */
      coff_core_file_failing_command,
--- 4424,4436 ----
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     _bfd_generic_bfd_merge_private_bfd_data,
      _bfd_generic_init_private_section_data,
!     _bfd_generic_bfd_copy_private_section_data,
!     _bfd_generic_bfd_copy_private_symbol_data,
!     _bfd_generic_bfd_copy_private_header_data,
!     _bfd_generic_bfd_set_private_flags,
!     _bfd_generic_bfd_print_private_bfd_data,
  
      /* Core */
      coff_core_file_failing_command,
*************** const bfd_target pmac_xcoff_vec =
*** 4439,4446 ****
  
      /* Archive */
      _bfd_xcoff_slurp_armap,
!     bfd_false,
!     ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false),
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
--- 4439,4446 ----
  
      /* Archive */
      _bfd_xcoff_slurp_armap,
!     _bfd_noarchive_slurp_extended_name_table,
!     _bfd_noarchive_construct_extended_name_table,
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
Index: coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.79
diff -c -p -r1.79 coff64-rs6000.c
*** coff64-rs6000.c	5 Sep 2009 07:56:21 -0000	1.79
--- coff64-rs6000.c	17 Nov 2009 11:12:46 -0000
*************** const bfd_target rs6000coff64_vec =
*** 2741,2753 ****
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
      _bfd_generic_init_private_section_data,
!     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
!     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
  
      /* Core */
      coff_core_file_failing_command,
--- 2741,2753 ----
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     _bfd_generic_bfd_merge_private_bfd_data,
      _bfd_generic_init_private_section_data,
!     _bfd_generic_bfd_copy_private_section_data,
!     _bfd_generic_bfd_copy_private_symbol_data,
!     _bfd_generic_bfd_copy_private_header_data,
!     _bfd_generic_bfd_set_private_flags,
!     _bfd_generic_bfd_print_private_bfd_data,
  
      /* Core */
      coff_core_file_failing_command,
*************** const bfd_target rs6000coff64_vec =
*** 2756,2763 ****
  
      /* Archive */
      xcoff64_slurp_armap,
!     bfd_false,
!     ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false),
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
--- 2756,2763 ----
  
      /* Archive */
      xcoff64_slurp_armap,
!     _bfd_noarchive_slurp_extended_name_table,
!     _bfd_noarchive_construct_extended_name_table,
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
*************** const bfd_target aix5coff64_vec =
*** 2995,3007 ****
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
      _bfd_generic_init_private_section_data,
!     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
!     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
!     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
  
      /* Core */
      xcoff64_core_file_failing_command,
--- 2995,3007 ----
  
      /* Copy */
      _bfd_xcoff_copy_private_bfd_data,
!     _bfd_generic_bfd_merge_private_bfd_data,
      _bfd_generic_init_private_section_data,
!     _bfd_generic_bfd_copy_private_section_data,
!     _bfd_generic_bfd_copy_private_symbol_data,
!     _bfd_generic_bfd_copy_private_header_data,
!     _bfd_generic_bfd_set_private_flags,
!     _bfd_generic_bfd_print_private_bfd_data,
  
      /* Core */
      xcoff64_core_file_failing_command,
*************** const bfd_target aix5coff64_vec =
*** 3010,3017 ****
  
      /* Archive */
      xcoff64_slurp_armap,
!     bfd_false,
!     ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false),
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,
--- 3010,3017 ----
  
      /* Archive */
      xcoff64_slurp_armap,
!     _bfd_noarchive_slurp_extended_name_table,
!     _bfd_noarchive_construct_extended_name_table,
      bfd_dont_truncate_arname,
      _bfd_xcoff_write_armap,
      _bfd_xcoff_read_ar_hdr,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]