This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8970

-- gerrit

commit 439c3caf6d798661aa77b0f9cdd0631696528479
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sat Jun 21 12:11:24 2025 +0200

    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 <borneo.anto...@gmail.com>

diff --git a/src/helper/types.h b/src/helper/types.h
index 53249e5b79..b3edd21184 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.
  * <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)))

-- 

Reply via email to