public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tristan Gingold <gingold@adacore.com>
To: Richard Sandiford <rdsandiford@googlemail.com>
Cc: binutils <binutils@sourceware.org>, Nick Clifton <nickc@redhat.com>
Subject: Re: [patch] Convert coff64-rs6000.c to iso-c
Date: Tue, 26 Apr 2011 09:14:00 -0000	[thread overview]
Message-ID: <76921E11-5AB5-4635-B4B1-FFF0BDAA14C4@adacore.com> (raw)
In-Reply-To: <g4vcy11jsg.fsf@googlemail.com>


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.

  reply	other threads:[~2011-04-26  9:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 12:21 [patch] Convert coff-rs6000.c " Tristan Gingold
2011-04-18 13:31 ` Nick Clifton
2011-04-18 14:00   ` Tristan Gingold
2011-04-21 10:22   ` Joseph S. Myers
2011-04-21 10:28     ` Tristan Gingold
2011-04-21 14:08     ` Nick Clifton
2011-04-22  8:02       ` [patch] Convert coff64-rs6000.c " Tristan Gingold
2011-04-22  8:19         ` Andreas Schwab
2011-04-22  8:24           ` Tristan Gingold
2011-04-26  8:47         ` Richard Sandiford
2011-04-26  9:14           ` Tristan Gingold [this message]
2011-04-22  8:10       ` [patch] Convert aix386-core " Tristan Gingold
2011-04-26  8:49         ` Richard Sandiford
2011-04-27  9:44           ` Nick Clifton
2011-04-21 21:22     ` [patch] Convert coff-rs6000.c " Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76921E11-5AB5-4635-B4B1-FFF0BDAA14C4@adacore.com \
    --to=gingold@adacore.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=rdsandiford@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).