From ad74320c05234cdaebc33b9f8b8e46a42e69954d Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 8 Jul 2024 12:34:19 +0200 Subject: [PATCH] qcdm: fix order of calloc() arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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); | ^~~ --- libqcdm/src/result.c | 12 ++++++------ 1 file 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;