From 13b74c3fc7718d3ac639d6c382b2a4e3ec70a6d1 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Sat, 21 Jun 2025 12:11:24 +0200 Subject: [PATCH] helper: types: fix proper return type in example of ARRAY_SIZE() 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 Reviewed-on: https://review.openocd.org/c/openocd/+/8970 Reviewed-by: zapb Tested-by: jenkins --- src/helper/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helper/types.h b/src/helper/types.h index 53249e5b7..b3edd2118 100644 --- a/src/helper/types.h +++ b/src/helper/types.h @@ -51,7 +51,7 @@ * Compute the number of elements of a variable length array. * * const char *strs[] = { "a", "b", "c" }; - * unsigned num_strs = ARRAY_SIZE(strs); + * size_t num_strs = ARRAY_SIZE(strs); * */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))