summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-02-23 16:14:24 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-02-23 16:15:01 -0800
commitc4ca8219dd6b8f06e67a0b767475b1259653b8e0 (patch)
tree42f9b4273fd50965587026a4f8e2dc55ee2e709b /lib
parentb95f78ed7b0cfda494d9d0d0c8ede1a911152007 (diff)
downloademacs-c4ca8219dd6b8f06e67a0b767475b1259653b8e0.tar.gz
Update from Gnulib
This incorporates: 2020-02-23 use 'restrict' * lib/careadlinkat.h, lib/md5.h, lib/sha1.h, lib/sha256.h: * lib/sha512.h, lib/strftime.h, lib/string.in.h, m4/nstrftime.m4: Copy from Gnulib. * m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'lib')
-rw-r--r--lib/careadlinkat.h2
-rw-r--r--lib/md5.h8
-rw-r--r--lib/sha1.h7
-rw-r--r--lib/sha256.h20
-rw-r--r--lib/sha512.h20
-rw-r--r--lib/strftime.h2
-rw-r--r--lib/string.in.h3
7 files changed, 37 insertions, 25 deletions
diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h
index 584cfe9ad8e..a4a37b274d0 100644
--- a/lib/careadlinkat.h
+++ b/lib/careadlinkat.h
@@ -47,7 +47,7 @@ struct allocator;
set errno. */
char *careadlinkat (int fd, char const *filename,
- char *buffer, size_t buffer_size,
+ char *restrict buffer, size_t buffer_size,
struct allocator const *alloc,
ssize_t (*preadlinkat) (int, char const *,
char *, size_t));
diff --git a/lib/md5.h b/lib/md5.h
index 239748ae0cb..3c6048242b0 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/lib/sha1.h b/lib/sha1.h
index 2c9c2d4a5e2..b76788487c3 100644
--- a/lib/sha1.h
+++ b/lib/sha1.h
@@ -71,20 +71,21 @@ extern void sha1_process_bytes (const void *buffer, size_t len,
in first 20 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 *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
+extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *restrict resbuf);
/* Put result from CTX in first 20 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 *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
+extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *restrict resbuf);
/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. 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 *sha1_buffer (const char *buffer, size_t len, void *resblock);
+extern void *sha1_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
# endif
/* Compute SHA1 message digest for bytes read from STREAM.
diff --git a/lib/sha256.h b/lib/sha256.h
index 1bc61d437c9..750d78a2696 100644
--- a/lib/sha256.h
+++ b/lib/sha256.h
@@ -70,23 +70,27 @@ extern void sha256_process_bytes (const void *buffer, size_t len,
in first 32 (28) 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 *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
-extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
+extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
+extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
/* Put result from CTX in first 32 (28) 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 *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
-extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
+extern void *sha256_read_ctx (const struct sha256_ctx *ctx,
+ void *restrict resbuf);
+extern void *sha224_read_ctx (const struct sha256_ctx *ctx,
+ void *restrict resbuf);
-/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The
- result is always in little endian byte order, so that a byte-wise
+/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER.
+ 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 *sha256_buffer (const char *buffer, size_t len, void *resblock);
-extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
+extern void *sha256_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
+extern void *sha224_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
# endif
/* Compute SHA256 (SHA224) message digest for bytes read from STREAM.
diff --git a/lib/sha512.h b/lib/sha512.h
index aaf35a5f7d8..21c2f580147 100644
--- a/lib/sha512.h
+++ b/lib/sha512.h
@@ -70,8 +70,8 @@ extern void sha512_process_bytes (const void *buffer, size_t len,
in first 64 (48) 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 *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
-extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
+extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *restrict resbuf);
+extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *restrict resbuf);
/* Put result from CTX in first 64 (48) bytes following RESBUF. The result is
@@ -80,16 +80,20 @@ extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
-extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
-extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
+extern void *sha512_read_ctx (const struct sha512_ctx *ctx,
+ void *restrict resbuf);
+extern void *sha384_read_ctx (const struct sha512_ctx *ctx,
+ void *restrict resbuf);
-/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER. The
- result is always in little endian byte order, so that a byte-wise
+/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER.
+ 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 *sha512_buffer (const char *buffer, size_t len, void *resblock);
-extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
+extern void *sha512_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
+extern void *sha384_buffer (const char *buffer, size_t len,
+ void *restrict resblock);
# endif
/* Compute SHA512 (SHA384) message digest for bytes read from STREAM.
diff --git a/lib/strftime.h b/lib/strftime.h
index 97a062c631d..e8501631573 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -25,7 +25,7 @@ extern "C" {
POSIX requires that strftime use the local timezone information.
Use the timezone __TZ instead. Use __NS as the number of
nanoseconds in the %N directive. */
-size_t nstrftime (char *, size_t, char const *, struct tm const *,
+size_t nstrftime (char *restrict, size_t, char const *, struct tm const *,
timezone_t __tz, int __ns);
#ifdef __cplusplus
diff --git a/lib/string.in.h b/lib/string.in.h
index 5bc00845205..596c99bf2e2 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -969,7 +969,8 @@ _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
Caveat: The identity of the delimiting character is lost.
See also mbssep(). */
-_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
+_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
+ char **save_ptr)
_GL_ARG_NONNULL ((2, 3));
#endif