From: Bruno Haible Date: Sun, 23 Feb 2020 12:15:15 +0000 (+0100) Subject: crypto/md5-buffer: Use 'restrict'. X-Git-Tag: v1.0~4208 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=94ff8af6bf3399c077cb907e56424d61fdea79d4;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index bd40d1b8bb..2ed99c45f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2020-02-23 Bruno Haible + 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. diff --git a/lib/md5.h b/lib/md5.h index 9e0c0fb3fc..0c8b929745 100644 --- 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. diff --git a/modules/crypto/md5-buffer b/modules/crypto/md5-buffer index 006bc81a4e..fb5763e511 100644 --- a/modules/crypto/md5-buffer +++ b/modules/crypto/md5-buffer @@ -15,6 +15,7 @@ stdalign stdint configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) gl_MD5 Makefile.am: