This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Convert coff64-rs6000.c to iso-c
On Apr 26, 2011, at 10:47 AM, Richard Sandiford wrote:
> Tristan Gingold <gingold@adacore.com> writes:
>> /* Relocation functions */
>> -static bfd_boolean xcoff64_reloc_type_br
>> - PARAMS ((XCOFF_RELOC_FUNCTION_ARGS));
>> +static bfd_boolean xcoff64_reloc_type_br (XCOFF_RELOC_FUNCTION_ARGS);
>
> BFD style is to have the (...) on the next line, regardless of whether
> it fits on the current one:
>
> static bfd_boolean xcoff64_reloc_type_br
> (XCOFF_RELOC_FUNCTION_ARGS);
Ok, I always was troubled by this style, as it is not always followed. eg bfd-in2.h:
extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
extern int bfd_seek (bfd *, file_ptr, int);
extern file_ptr bfd_tell (bfd *);
extern int bfd_flush (bfd *);
extern int bfd_stat (bfd *, struct stat *);
Anyway, I will fix that.
>
>> @@ -241,14 +238,11 @@ bfd_boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION])
>> #define coff_bfd_reloc_type_lookup xcoff64_reloc_type_lookup
>> #define coff_bfd_reloc_name_lookup xcoff64_reloc_name_lookup
>> #ifdef AIX_CORE
>> -extern const bfd_target * rs6000coff_core_p
>> - PARAMS ((bfd *abfd));
>> +extern const bfd_target * rs6000coff_core_p (bfd *abfd);
>> extern bfd_boolean rs6000coff_core_file_matches_executable_p
>> - PARAMS ((bfd *cbfd, bfd *ebfd));
>> -extern char *rs6000coff_core_file_failing_command
>> - PARAMS ((bfd *abfd));
>> -extern int rs6000coff_core_file_failing_signal
>> - PARAMS ((bfd *abfd));
>> + (bfd *cbfd, bfd *ebfd);
>> +extern char *rs6000coff_core_file_failing_command (bfd *abfd);
>> +extern int rs6000coff_core_file_failing_signal (bfd *abfd);
>> #define CORE_FILE_P rs6000coff_core_p
>> #define coff_core_file_failing_command \
>> rs6000coff_core_file_failing_command
>
> Same here.
>
>> {
>> union internal_auxent *in = (union internal_auxent *) inp;
>> union external_auxent *ext = (union external_auxent *) extp;
>>
>> - memset ((PTR) ext, 0, bfd_coff_auxesz (abfd));
>> + memset ((void *) ext, 0, bfd_coff_auxesz (abfd));
>
> Just drop the (PTR) conversion. (void *) casts aren't necessary
> and tend to make things less readable. We certainly won't be able
> to enforce explicit (void *) casts for future changes, so the code
> would become inconsistent.
Right. This was a mechanical change!
> Same throughout.
>
>> @@ -2829,16 +2750,11 @@ const bfd_target rs6000coff64_vec =
>> (void *) &bfd_xcoff_backend_data,
>> };
>>
>> -extern const bfd_target *xcoff64_core_p
>> - PARAMS ((bfd *));
>> -extern bfd_boolean xcoff64_core_file_matches_executable_p
>> - PARAMS ((bfd *, bfd *));
>> -extern char *xcoff64_core_file_failing_command
>> - PARAMS ((bfd *));
>> -extern int xcoff64_core_file_failing_signal
>> - PARAMS ((bfd *));
>> -#define xcoff64_core_file_pid \
>> - _bfd_nocore_core_file_pid
>> +extern const bfd_target *xcoff64_core_p (bfd *);
>> +extern bfd_boolean xcoff64_core_file_matches_executable_p (bfd *, bfd *);
>> +extern char *xcoff64_core_file_failing_command (bfd *);
>> +extern int xcoff64_core_file_failing_signal (bfd *);
>> +#define xcoff64_core_file_pid _bfd_nocore_core_file_pid
>
> More cases where the params should stay on their current line.
>
> OK with those changes, thanks.
Thanks. Will make the changes.
Tristan.