[patch] update_global_location_list my comment fix [Re: [PATCH] Fix breakpoint updates for multi-inferior]

Luis Gustavo luis_gustavo@mentor.com
Wed Feb 8 23:40:00 GMT 2012


On 02/08/2012 09:32 PM, Joel Brobecker wrote:
> I don't know this area, so cannot formally review, but a minor comment:
>
>> +  if (a->pspace != b->pspace)
>> +    return (a->pspace>  b->pspace)
>> +	   - (a->pspace<  b->pspace);
>
> The GNU Coding Standards asks us to use an extra pair of parentheses
> in order to help code formatters, even if it is strictly not necessary
> here, thus:
>
>          return ((a->pspace>  b->pspace)
>                  - ((a->pspace<  b->pspace)));
>
> But going beyond this, ISTM that you can simply put the entire
> expression on one line and be done with it:
>
>    if (a->pspace != b->pspace)
>      return (a->pspace>  b->pspace) - (a->pspace<  b->pspace);
>

I went with putting everything on one line.

Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix_multiprocess_breaks.diff
Type: text/x-patch
Size: 932 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120208/024f23d7/attachment.bin>


More information about the Gdb-patches mailing list