]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/: Use a consistent name for macro arguments representing a type name
authorAlejandro Colomar <alx@kernel.org>
Sat, 15 Nov 2025 19:55:25 +0000 (20:55 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 5 Dec 2025 14:34:32 +0000 (08:34 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/alloc/calloc.h
lib/alloc/malloc.h
lib/alloc/realloc.h
lib/alloc/reallocf.h
lib/search/cmp/cmp.h

index c6db93dc26b7eec74893509047aedb0748fb61f5..82aec97bcef0c8c8bab2069e729047ca18fc7578 100644 (file)
 #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
index 1c0c2366afe6df370dea71f1f9d506ba01ffc341..b7e4a9453149a581f1a0628eeb36d98776cd52de 100644 (file)
 #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)
index 10b68e0fe10173d53ab16e2cda47ae219587d9a2..0ac158c73e5eb3d60b0003eb726d7f4e90a2b9c3 100644 (file)
 #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
index d476dbffdb64d72aced0d81142d18b25f4001cc3..dede23f585af93e1b0295b6fc026f4c1e533a5c7 100644 (file)
@@ -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))) \
 )
 
 
index e7444ab21d8b83151d4a53339511c187d2d72697..2f8822119517a7c2f0d62a0ea930c748f0ade4c8 100644 (file)
@@ -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,                           \