Mercurial > gnulib
changeset 39325:e4fc73a73375
af_alg: Improve function signature.
* lib/af_alg.h (afalg_stream): Swap second and third argument.
* lib/af_alg.c (afalg_stream): Likewise.
* lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c: Callers changed.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 05 May 2018 18:13:16 +0200 |
parents | 570dfb586b40 |
children | c82e97c04ab4 |
files | ChangeLog lib/af_alg.c lib/af_alg.h lib/md5.c lib/sha1.c lib/sha256.c lib/sha512.c |
diffstat | 7 files changed, 16 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat May 05 18:09:40 2018 +0200 +++ b/ChangeLog Sat May 05 18:13:16 2018 +0200 @@ -1,3 +1,10 @@ +2018-05-05 Bruno Haible <bruno@clisp.org> + + af_alg: Improve function signature. + * lib/af_alg.h (afalg_stream): Swap second and third argument. + * lib/af_alg.c (afalg_stream): Likewise. + * lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c: Callers changed. + 2018-05-05 Bruno Haible <bruno@clisp.org> crypto/{md5,sha1,sha256,sha512}: Fix compilation error (S_TYPEISTMO).
--- a/lib/af_alg.c Sat May 05 18:09:40 2018 +0200 +++ b/lib/af_alg.c Sat May 05 18:13:16 2018 +0200 @@ -35,7 +35,7 @@ #define BLOCKSIZE 32768 int -afalg_stream (FILE * stream, void *resblock, const char *alg, ssize_t hashlen) +afalg_stream (FILE * stream, const char *alg, void *resblock, ssize_t hashlen) { struct sockaddr_alg salg = { .salg_family = AF_ALG,
--- a/lib/af_alg.h Sat May 05 18:09:40 2018 +0200 +++ b/lib/af_alg.h Sat May 05 18:13:16 2018 +0200 @@ -58,12 +58,12 @@ If successful, this function fills RESBLOCK and returns 0. Upon failure, it returns a negated error code. */ int -afalg_stream (FILE *stream, void *resblock, const char *alg, ssize_t hashlen); +afalg_stream (FILE *stream, const char *alg, void *resblock, ssize_t hashlen); # else static int -afalg_stream (FILE *stream, void *resblock, const char *alg, ssize_t hashlen) +afalg_stream (FILE *stream, const char *alg, void *resblock, ssize_t hashlen) { return -EAFNOSUPPORT; }
--- a/lib/md5.c Sat May 05 18:09:40 2018 +0200 +++ b/lib/md5.c Sat May 05 18:13:16 2018 +0200 @@ -151,7 +151,7 @@ #ifdef HAVE_LINUX_IF_ALG_H int ret; - ret = afalg_stream(stream, resblock, "md5", MD5_DIGEST_SIZE); + ret = afalg_stream (stream, "md5", resblock, MD5_DIGEST_SIZE); if (!ret) return 0;
--- a/lib/sha1.c Sat May 05 18:09:40 2018 +0200 +++ b/lib/sha1.c Sat May 05 18:13:16 2018 +0200 @@ -138,7 +138,7 @@ #ifdef HAVE_LINUX_IF_ALG_H int ret; - ret = afalg_stream(stream, resblock, "sha1", SHA1_DIGEST_SIZE); + ret = afalg_stream (stream, "sha1", resblock, SHA1_DIGEST_SIZE); if (!ret) return 0;
--- a/lib/sha256.c Sat May 05 18:09:40 2018 +0200 +++ b/lib/sha256.c Sat May 05 18:13:16 2018 +0200 @@ -186,7 +186,7 @@ #ifdef HAVE_LINUX_IF_ALG_H int ret; - ret = afalg_stream(stream, resblock, "sha256", SHA256_DIGEST_SIZE); + ret = afalg_stream(stream, "sha256", resblock, SHA256_DIGEST_SIZE); if (!ret) return 0; @@ -269,7 +269,7 @@ #ifdef HAVE_LINUX_IF_ALG_H int ret; - ret = afalg_stream(stream, resblock, "sha224", SHA224_DIGEST_SIZE); + ret = afalg_stream (stream, "sha224", resblock, SHA224_DIGEST_SIZE); if (!ret) return 0;
--- a/lib/sha512.c Sat May 05 18:09:40 2018 +0200 +++ b/lib/sha512.c Sat May 05 18:13:16 2018 +0200 @@ -194,7 +194,7 @@ #ifdef HAVE_LINUX_IF_ALG_H int ret; - ret = afalg_stream(stream, resblock, "sha512", SHA512_DIGEST_SIZE); + ret = afalg_stream (stream, "sha512", resblock, SHA512_DIGEST_SIZE); if (!ret) return 0; @@ -277,7 +277,7 @@ #ifdef HAVE_LINUX_IF_ALG_H int ret; - ret = afalg_stream(stream, resblock, "sha384", SHA384_DIGEST_SIZE); + ret = afalg_stream (stream, "sha384", resblock, SHA384_DIGEST_SIZE); if (!ret) return 0;