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);
        |                         ^~~
This commit is contained in:
Lubomir Rintel
2024-07-08 12:37:12 +02:00
parent 79b0696a74
commit ad74320c05
+6 -6
View File
@@ -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;