]> Savannah Git Hosting - gnulib.git/commitdiff
af_alg: Improve function signature.
authorBruno Haible <bruno@clisp.org>
Sat, 5 May 2018 16:13:16 +0000 (18:13 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 5 May 2018 16:13:16 +0000 (18:13 +0200)
* 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.

ChangeLog
lib/af_alg.c
lib/af_alg.h
lib/md5.c
lib/sha1.c
lib/sha256.c
lib/sha512.c

index 54268178d92024e092352ce188044e773110227a..0b38ffe7914b467dc21881abeeca87ad7b062c8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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).
index 3af099e432776f2b3a417c3dae26e331d4f7d7d0..91f565d439f342b5a2ef3eca4b256a38efd34646 100644 (file)
@@ -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,
index e9580d4359b49617cbab4bb1785b8de2515756f2..aacb8f606a47ada9fc619cc973d061f3ba0207dc 100644 (file)
@@ -58,12 +58,12 @@ extern "C" {
    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;
 }
index 307abbbe7a3f9dff193250ebda2540b96061f19a..e6bd2099e5d783024b1a822904ba660d72bc72e4 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -151,7 +151,7 @@ md5_stream (FILE *stream, void *resblock)
 #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;
 
index a84bf211ad5009f5458828915c78da559ab6a733..b670267c2b2514f8386d0f949f784e51b43dcec5 100644 (file)
@@ -138,7 +138,7 @@ sha1_stream (FILE *stream, void *resblock)
 #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;
 
index 578f43e4df9313abe71d4109444b24a2c4743d62..fab119a16eec7cca84dd2d313cafe99ec2cc8765 100644 (file)
@@ -186,7 +186,7 @@ sha256_stream (FILE *stream, void *resblock)
 #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 @@ sha224_stream (FILE *stream, void *resblock)
 #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;
 
index 72e5fdd241cbccaa3243cdb2afba691688451672..ff7c0cb07dceb61553b2daae0fac2159dc250ae2 100644 (file)
@@ -194,7 +194,7 @@ sha512_stream (FILE *stream, void *resblock)
 #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 @@ sha384_stream (FILE *stream, void *resblock)
 #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;