This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

Re: [PATCH v2 3/3] Add test for thread names


On 15-11-26 11:57 AM, Pedro Alves wrote:
> On 11/26/2015 03:59 PM, Simon Marchi wrote:
> 
>> I modified names.c significantly, so could you give it another quick look?
> 
> Looks great, thanks.
> 
>> +  /* Make sure that NAMES contains NUM_THREADS elements.  */
>> +  assert (sizeof (names) == sizeof (names[0]) * NUM_THREADS);
> 
> BTW, the standard pattern would be:
> 
>   assert (sizeof (names) / sizeof (names[0]) == NUM_THREADS);

You are right, it's better like that.

> which at least my brain processes immediately like ARRAY_SIZE,
> while with the * form, I have to stop and think.
> 
> Thanks,
> Pedro Alves

Pushed, thanks!


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