From b5c5791fe70655e39b3ac7973423cf8b1d65007c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 14 Oct 2025 12:35:31 +0200 Subject: [PATCH] */: s/SIZEOF_ARRAY/sizeof_a/ This name better reflects that it handles arrays, and doesn't shout. Signed-off-by: Alejandro Colomar --- lib/sizeof.h | 3 ++- lib/string/memset/memzero.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sizeof.h b/lib/sizeof.h index a3be1a7c4..5b63efd5f 100644 --- a/lib/sizeof.h +++ b/lib/sizeof.h @@ -23,7 +23,8 @@ # define countof(a) (sizeof(a) / sizeof((a)[0])) #endif -#define SIZEOF_ARRAY(a) (countof(a) * sizeof((a)[0])) +// sizeof_a - sizeof array +#define sizeof_a(a) (countof(a) * sizeof((a)[0])) #define STRLEN(s) (countof("" s "") - 1) diff --git a/lib/string/memset/memzero.h b/lib/string/memset/memzero.h index 7b8693dc4..caa4c0636 100644 --- a/lib/string/memset/memzero.h +++ b/lib/string/memset/memzero.h @@ -16,7 +16,7 @@ #include "sizeof.h" -#define MEMZERO(arr) memzero(arr, SIZEOF_ARRAY(arr)) +#define MEMZERO(arr) memzero(arr, sizeof_a(arr)) inline void *memzero(void *ptr, size_t size); -- 2.47.3