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:
Frantisek Sumsal
2024-01-17 11:09:09 +01:00
parent b551a687a4
commit fdd84270df
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -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;