From: Alejandro Colomar Date: Sat, 15 Nov 2025 19:55:25 +0000 (+0100) Subject: lib/: Use a consistent name for macro arguments representing a type name X-Git-Tag: 4.19.0-rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97380c811a314d2ea8684f60c1acec69a44accd3;p=thirdparty%2Fshadow.git lib/: Use a consistent name for macro arguments representing a type name Signed-off-by: Alejandro Colomar --- diff --git a/lib/alloc/calloc.h b/lib/alloc/calloc.h index c6db93dc2..82aec97bc 100644 --- a/lib/alloc/calloc.h +++ b/lib/alloc/calloc.h @@ -13,13 +13,13 @@ #include "exit_if_null.h" -#define CALLOC(n, type) \ -( \ - (type *) calloc(n, sizeof(type)) \ +#define CALLOC(n, T) \ +( \ + (T *) calloc(n, sizeof(T)) \ ) -#define XCALLOC(n, type) exit_if_null(CALLOC(n, type)) +#define XCALLOC(n, T) exit_if_null(CALLOC(n, T)) #endif // include guard diff --git a/lib/alloc/malloc.h b/lib/alloc/malloc.h index 1c0c2366a..b7e4a9453 100644 --- a/lib/alloc/malloc.h +++ b/lib/alloc/malloc.h @@ -14,13 +14,13 @@ #include "exit_if_null.h" -#define MALLOC(n, type) \ -( \ - (type *) mallocarray(n, sizeof(type)) \ +#define MALLOC(n, T) \ +( \ + (T *) mallocarray(n, sizeof(T)) \ ) -#define XMALLOC(n, type) exit_if_null(MALLOC(n, type)) +#define XMALLOC(n, T) exit_if_null(MALLOC(n, T)) ATTR_ALLOC_SIZE(1, 2) diff --git a/lib/alloc/realloc.h b/lib/alloc/realloc.h index 10b68e0fe..0ac158c73 100644 --- a/lib/alloc/realloc.h +++ b/lib/alloc/realloc.h @@ -13,13 +13,13 @@ #include "exit_if_null.h" -#define REALLOC(p, n, type) \ -( \ - _Generic(p, type *: (type *) reallocarray(p, (n) ?: 1, sizeof(type))) \ +#define REALLOC(p, n, T) \ +( \ + _Generic(p, T *: (T *) reallocarray(p, (n) ?: 1, sizeof(T))) \ ) -#define XREALLOC(p, n, type) exit_if_null(REALLOC(p, n, type)) +#define XREALLOC(p, n, T) exit_if_null(REALLOC(p, n, T)) #endif // include guard diff --git a/lib/alloc/reallocf.h b/lib/alloc/reallocf.h index d476dbffd..dede23f58 100644 --- a/lib/alloc/reallocf.h +++ b/lib/alloc/reallocf.h @@ -14,9 +14,9 @@ #include "attr.h" -#define REALLOCF(p, n, type) \ -( \ - _Generic(p, type *: (type *) reallocarrayf(p, (n) ?: 1, sizeof(type)))\ +#define REALLOCF(p, n, T) \ +( \ + _Generic(p, T *: (T *) reallocarrayf(p, (n) ?: 1, sizeof(T))) \ ) diff --git a/lib/search/cmp/cmp.h b/lib/search/cmp/cmp.h index e7444ab21..2f8822119 100644 --- a/lib/search/cmp/cmp.h +++ b/lib/search/cmp/cmp.h @@ -9,9 +9,9 @@ #include "config.h" -#define CMP(TYPE) \ +#define CMP(T) \ ( \ - _Generic((TYPE) 0, \ + _Generic((T) 0, \ int *: cmp_int, \ long *: cmp_long, \ unsigned int *: cmp_uint, \