Reorder arguments for calloc()-like functions, part #2
To appease gcc-14's -Wcalloc-transposed-args check.
Follow-up for 2a9ab0974b.
This commit is contained in:
+2
-2
@@ -36,7 +36,7 @@ static inline void *xmalloc(size_t size) {
|
||||
}
|
||||
|
||||
_malloc_ _alloc_(1, 2) _returns_nonnull_ _warn_unused_result_
|
||||
static inline void *xmalloc_multiply(size_t size, size_t n) {
|
||||
static inline void *xmalloc_multiply(size_t n, size_t size) {
|
||||
assert_se(!__builtin_mul_overflow(size, n, &size));
|
||||
return xmalloc(size);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ static inline void* xmemdup(const void *p, size_t l) {
|
||||
return memcpy(xmalloc(l), p, l);
|
||||
}
|
||||
|
||||
#define xnew(type, n) ((type *) xmalloc_multiply(sizeof(type), (n)))
|
||||
#define xnew(type, n) ((type *) xmalloc_multiply((n), sizeof(type)))
|
||||
|
||||
typedef struct {
|
||||
EFI_PHYSICAL_ADDRESS addr;
|
||||
|
||||
Reference in New Issue
Block a user