On November 12, 2004 12:17 pm, RĂ©mi Assailly wrote:
Changelog:
- just replace all (sizeof(MM_MLDrvs) / sizeof(MM_MLDrvs[0]) by
MAX_MM_MLDRVS to be more readable. ( I think it is )
I think it isn't.
(sizeof(a)/sizeof(a[0]) or (sizeof(a)/sizeof(*a)) is a standard statement that means "the number of elements in a". Some people make a macro such as COUNTOF(a) to make it more readable but the expanded version is quite standard.
The altered version is less readable because one then has to go back to the definition of MAX_MM_MLDRVS and its uses to see that indeed it is (or at least is supposed to be) the number of elements in the array that the statements are protecting.