The example in the comment above the declaration of the macro
ARRAY_SIZE() assigns the value to a variable of type 'unsigned'
that is not allowed by the coding style (should be 'unsigned int')
and is not correct since the macro uses 'sizeof()' and the type
returned is 'size_t'.
Fix the comment.
Change-Id: I18c32b5328a229ab74b56dafab46a064ce5d23c5
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8970
Reviewed-by: zapb <dev@zapb.de>
Tested-by: jenkins
* Compute the number of elements of a variable length array.
* <code>
* const char *strs[] = { "a", "b", "c" };
- * unsigned num_strs = ARRAY_SIZE(strs);
+ * size_t num_strs = ARRAY_SIZE(strs);
* </code>
*/
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))