]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/gc: Silence some -Wcalloc-transposed-args warnings.
authorBruno Haible <bruno@clisp.org>
Wed, 2 Apr 2025 22:52:14 +0000 (00:52 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 2 Apr 2025 22:52:14 +0000 (00:52 +0200)
* lib/gc-gnulib.c (gc_cipher_open, gc_hash_open, gc_hash_clone): Swap
the arguments of calloc().

ChangeLog
lib/gc-gnulib.c

index d680249a9524dc9a8d485593c682698927647da0..8dd75cabcb9d50d9e879f16587dec06da5b895ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-02  Bruno Haible  <bruno@clisp.org>
+
+       crypto/gc: Silence some -Wcalloc-transposed-args warnings.
+       * lib/gc-gnulib.c (gc_cipher_open, gc_hash_open, gc_hash_clone): Swap
+       the arguments of calloc().
+
 2025-04-02  Bruno Haible  <bruno@clisp.org>
 
        Silence some -Wunterminated-string-initialization warnings.
index 11870adcc5b2be35ac46c76a6035c9152df3202b..4eaf9a7656f2a3295b34e7d0d4e86bd783649f22 100644 (file)
@@ -174,7 +174,7 @@ gc_cipher_open (Gc_cipher alg, Gc_cipher_mode mode,
   _gc_cipher_ctx *ctx;
   Gc_rc rc = GC_OK;
 
-  ctx = calloc (sizeof (*ctx), 1);
+  ctx = calloc (1, sizeof (*ctx));
   if (!ctx)
     return GC_MALLOC_ERROR;
 
@@ -563,7 +563,7 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle)
   if (mode != 0)
     return GC_INVALID_HASH;
 
-  ctx = calloc (sizeof (*ctx), 1);
+  ctx = calloc (1, sizeof (*ctx));
   if (!ctx)
     return GC_MALLOC_ERROR;
 
@@ -634,7 +634,7 @@ gc_hash_clone (gc_hash_handle handle, gc_hash_handle * outhandle)
   _gc_hash_ctx *in = handle;
   _gc_hash_ctx *out;
 
-  *outhandle = out = calloc (sizeof (*out), 1);
+  *outhandle = out = calloc (1, sizeof (*out));
   if (!out)
     return GC_MALLOC_ERROR;