>From b9eae96869cc9cef3865505ab8dc356196f241e9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:06:29 +0100 Subject: [PATCH 02/29] astrxfrm: Use 'restrict'. * lib/astrxfrm.h (astrxfrm): Use 'restrict'. * modules/astrxfrm (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/astrxfrm.h | 3 ++- modules/astrxfrm | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 563d770..80a90eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + astrxfrm: Use 'restrict'. + * lib/astrxfrm.h (astrxfrm): Use 'restrict'. + * modules/astrxfrm (configure.ac): Require AC_C_RESTRICT. + amemxfrm: Use 'restrict'. * lib/amemxfrm.h (amemxfrm): Use 'restrict'. * modules/amemxfrm (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/astrxfrm.h b/lib/astrxfrm.h index a23ed70..211fe3b 100644 --- a/lib/astrxfrm.h +++ b/lib/astrxfrm.h @@ -37,7 +37,8 @@ extern "C" { freshly allocated string is returned. In both cases, *lengthp is set to the length of the returned string. Upon failure, return NULL, with errno set. */ -extern char * astrxfrm (const char *s, char *resultbuf, size_t *lengthp); +extern char * astrxfrm (const char *s, + char *restrict resultbuf, size_t *lengthp); #ifdef __cplusplus diff --git a/modules/astrxfrm b/modules/astrxfrm index e2edc42..0533403 100644 --- a/modules/astrxfrm +++ b/modules/astrxfrm @@ -8,6 +8,7 @@ lib/astrxfrm.c Depends-on: configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) Makefile.am: lib_SOURCES += astrxfrm.c -- 2.7.4