On 11/28/2011 03:09 PM, Marc Kleine-Budde wrote:
> On 11/28/2011 03:03 PM, David Laight wrote:
>>>>> + for (idx = 0; idx < MAXDEV; idx++) {
>>>> ARRAY_SIZE?
>>>
>>> Well, I think ARRAY_SIZE is useful to derive the number of 
>>> elements from a static array of the type:
>>>
>>>   static const int array[] = { 1, 2, 3, 4, }
>>>
>>> but not if its declared as:
>>>
>>>   static array[MAXDEV]:
>>>
>>> ... or have I missed something?
>>
>> Yes - if you use ARRAY_SIZE() then someone reading the code
>> doesn't need to find the array definition to ensure the loop
>> upper bound is correct.
> 
> Yep, that
> was my intention, too.

OK, I see, and as we are all just human beings ...

Wolfgang.
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to