diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2024-07-08 12:34:19 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2024-07-08 12:37:12 +0200 |
commit | ad74320c05234cdaebc33b9f8b8e46a42e69954d (patch) | |
tree | b3000e382cd181c17c9d1eea5144c947d37047c8 | |
parent | 79b0696a7458db9ea26bf4e9412bdb3cc9ed6fcb (diff) |
qcdm: fix order of calloc() arguments
GCC 14 is unhappy. Not sure why does this matter, maybe it just does
not. Let's silence the warning at the very least:
libqcdm/src/result.c: In function ‘val_new_string’:
libqcdm/src/result.c:76:25: warning: ‘calloc’ sizes specified with
‘sizeof’ in the earlier argument and not in the later argument
[-Wcalloc-transposed-args]
76 | v = calloc (sizeof (Val), 1);
| ^~~
-rw-r--r-- | libqcdm/src/result.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libqcdm/src/result.c b/libqcdm/src/result.c index 65f6c6a5..a9873673 100644 --- a/libqcdm/src/result.c +++ b/libqcdm/src/result.c @@ -73,7 +73,7 @@ val_new_string (const char *key, const char *value) qcdm_return_val_if_fail (key[0] != '\0', NULL); qcdm_return_val_if_fail (value != NULL, NULL); - v = calloc (sizeof (Val), 1); + v = calloc (1, sizeof (Val)); if (v == NULL) return NULL; @@ -91,7 +91,7 @@ val_new_u8 (const char *key, uint8_t u) qcdm_return_val_if_fail (key != NULL, NULL); qcdm_return_val_if_fail (key[0] != '\0', NULL); - v = calloc (sizeof (Val), 1); + v = calloc (1, sizeof (Val)); if (v == NULL) return NULL; @@ -111,7 +111,7 @@ val_new_u8_array (const char *key, const uint8_t *array, size_t array_len) qcdm_return_val_if_fail (array != NULL, NULL); qcdm_return_val_if_fail (array_len > 0, NULL); - v = calloc (sizeof (Val), 1); + v = calloc (1, sizeof (Val)); if (v == NULL) return NULL; @@ -136,7 +136,7 @@ val_new_u32 (const char *key, uint32_t u) qcdm_return_val_if_fail (key != NULL, NULL); qcdm_return_val_if_fail (key[0] != '\0', NULL); - v = calloc (sizeof (Val), 1); + v = calloc (1, sizeof (Val)); if (v == NULL) return NULL; @@ -157,7 +157,7 @@ val_new_u16_array (const char *key, const uint16_t *array, size_t array_len) qcdm_return_val_if_fail (array != NULL, NULL); qcdm_return_val_if_fail (array_len > 0, NULL); - v = calloc (sizeof (Val), 1); + v = calloc (1, sizeof (Val)); if (v == NULL) return NULL; @@ -187,7 +187,7 @@ qcdm_result_new (void) { QcdmResult *r; - r = calloc (sizeof (QcdmResult), 1); + r = calloc (1, sizeof (QcdmResult)); if (r) r->refcount = 1; return r; |