>From 7d4a2b0c17628cc4e5fc159b26498564706ee1be Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 13:22:42 +0100 Subject: [PATCH 26/29] crypto/*-buffer: Use 'restrict'. * lib/gl_openssl.h (GL_CRYPTO_FN (_finish_ctx), GL_CRYPTO_FN (_buffer), GL_CRYPTO_FN (_read_ctx)): Use 'restrict'. --- ChangeLog | 4 ++++ lib/gl_openssl.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8701bea..768083e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + crypto/*-buffer: Use 'restrict'. + * lib/gl_openssl.h (GL_CRYPTO_FN (_finish_ctx), GL_CRYPTO_FN (_buffer), + GL_CRYPTO_FN (_read_ctx)): Use 'restrict'. + crypto/sha512-buffer: Use 'restrict'. * lib/sha512.h (sha512_finish_ctx, sha384_finish_ctx, sha512_read_ctx, sha384_read_ctx, sha512_buffer, sha384_buffer): Use 'restrict'. diff --git a/lib/gl_openssl.h b/lib/gl_openssl.h index e5991d8..e985b1c 100644 --- a/lib/gl_openssl.h +++ b/lib/gl_openssl.h @@ -90,15 +90,15 @@ GL_CRYPTO_FN (_process_block) (const void *buf, size_t len, struct _gl_ctx *ctx) #endif GL_OPENSSL_INLINE void * -GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *res) +GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *restrict res) { OPENSSL_FN (_Final) ((unsigned char *) res, (_gl_CTX *) ctx); return res; } GL_OPENSSL_INLINE void * -GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *res) +GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *restrict res) { return OPENSSL_FN () ((const unsigned char *) buf, len, (unsigned char *) res); } GL_OPENSSL_INLINE void * -GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *res) +GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *restrict res) { /* Assume any unprocessed bytes in ctx are not to be ignored. */ _gl_CTX tmp_ctx = *(_gl_CTX *) ctx; -- 2.7.4