From: Bruno Haible Date: Wed, 2 Apr 2025 22:52:14 +0000 (+0200) Subject: crypto/gc: Silence some -Wcalloc-transposed-args warnings. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=bb506f75625b47d7844af2b6dc4b8192d4dea676;p=gnulib.git 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(). --- diff --git a/ChangeLog b/ChangeLog index d680249a95..8dd75cabcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-04-02 Bruno Haible + + 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 Silence some -Wunterminated-string-initialization warnings. diff --git a/lib/gc-gnulib.c b/lib/gc-gnulib.c index 11870adcc5..4eaf9a7656 100644 --- a/lib/gc-gnulib.c +++ b/lib/gc-gnulib.c @@ -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;