]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/md5-buffer: Use 'restrict'.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:15:15 +0000 (13:15 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:15:15 +0000 (13:15 +0100)
* lib/md5.h (__md5_finish_ctx, __md5_read_ctx, __md5_buffer): Use
'restrict'.
* modules/crypto/md5-buffer (configure.ac): Require AC_C_RESTRICT.

ChangeLog
lib/md5.h
modules/crypto/md5-buffer

index bd40d1b8bb841ec89791a5a19341eb5d1d50b31d..2ed99c45f06f33cad9ac9baed016135fbec4df8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2020-02-23  Bruno Haible  <bruno@clisp.org>
 
+       crypto/md5-buffer: Use 'restrict'.
+       * lib/md5.h (__md5_finish_ctx, __md5_read_ctx, __md5_buffer): Use
+       'restrict'.
+       * modules/crypto/md5-buffer (configure.ac): Require AC_C_RESTRICT.
+
        crypto/md4: Use 'restrict'.
        * lib/md4.h (md4_finish_ctx, md4_read_ctx, md4_buffer): Use 'restrict'.
        * modules/crypto/md4 (configure.ac): Require AC_C_RESTRICT.
index 9e0c0fb3fcbca6f874c978fe02b646ac69bfcfe5..0c8b9297455d663dd7e0033535f8006dcd0e4b9b 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -105,13 +105,15 @@ extern void __md5_process_bytes (const void *buffer, size_t len,
    in first 16 bytes following RESBUF.  The result is always in little
    endian byte order, so that a byte-wise output yields to the wanted
    ASCII representation of the message digest.  */
-extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
+extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *restrict resbuf)
+     __THROW;
 
 
 /* Put result from CTX in first 16 bytes following RESBUF.  The result is
    always in little endian byte order, so that a byte-wise output yields
    to the wanted ASCII representation of the message digest.  */
-extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
+extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *restrict resbuf)
+     __THROW;
 
 
 /* Compute MD5 message digest for LEN bytes beginning at BUFFER.  The
@@ -119,7 +121,7 @@ extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
    output yields to the wanted ASCII representation of the message
    digest.  */
 extern void *__md5_buffer (const char *buffer, size_t len,
-                           void *resblock) __THROW;
+                           void *restrict resblock) __THROW;
 
 # endif
 /* Compute MD5 message digest for bytes read from STREAM.
index 006bc81a4e71abeec72b39249bfcef1e8f24a972..fb5763e511afbb168c69f5497cda931c520347df 100644 (file)
@@ -15,6 +15,7 @@ stdalign
 stdint
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 gl_MD5
 
 Makefile.am: