From 380c9f61651aaa785dc0d678edd17c17af1c6f90 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 26 Nov 2013 17:21:01 +0000 Subject: [PATCH] 2013-11-26 Julio Gutierrez *libc/include/wchar.h: Add restrict keyword. *libc/stdio/fgetws.c (fgetws): ditto. *libc/stdio/fputws.c (fputws): ditto. *libc/stdio/fwprintf.c (fwprintf): ditto. *libc/stdio/fwscanf.c (fwscanf): ditto. *libc/stdio/swprintf.c (swprintf): ditto. *libc/stdio/swscanf.c (swscanf): ditto. *libc/stdio/vfwprintf.c (vfwprintf): ditto. *libc/stdio/vfwscanf.c (vfwscanf): ditto. *libc/stdio/vswprintf.c (vswprintf): ditto. *libc/stdio/vswscanf.c (vswscanf): ditto. *libc/stdio/vwprintf.c (vwprintf): ditto. *libc/stdio/vwscanf.c (vwscanf): ditto. *libc/stdio/wprintf.c (wprintf): ditto. *libc/stdio/wscanf.c (wscanf): ditto. *libc/stdlib/mbrlen.c (mbrlen): ditto. *libc/stdlib/mbrtowc.c (mbrtowc): ditto. *libc/stdlib/mbsnrtowcs.c (mbsnrtowcs): ditto. *libc/stdlib/mbsrtowcs.c (mbsrtowcs): ditto. *libc/stdlib/wcrtomb.c (wcrtomb): ditto. *libc/stdlib/wcsnrtombs.c (wcsnrtombs): ditto. *libc/stdlib/wcsrtombs.c (wcsrtombs): ditto. *libc/stdlib/wcstod.c (wcstod): ditto. *libc/stdlib/wcstol.c (wcstol): ditto. *libc/stdlib/wcstold.c (wcstold): ditto. *libc/stdlib/wcstoll.c (wcstoll): ditto. *libc/stdlib/wcstoul.c (wcstoul): ditto. *libc/stdlib/wcstoull.c (cstoull): ditto. *libc/string/wcpcpy.c (wcpcpy): ditto. *libc/string/wcpncpy.c (wcpncpy): ditto. *libc/string/wcscat.c (wcscat): ditto. *libc/string/wcscpy.c (wcscpy): ditto. *libc/string/wcsncat.c (wcsncat): ditto. *libc/string/wcsncpy.c (wcsncpy): ditto. *libc/string/wcsstr.c (wcsstr): ditto. *libc/string/wcstok.c (wcstok): ditto. *libc/string/wcsxfrm.c (wcsxfrm): ditto. *libc/string/wmemcpy.c (wmemcpy): ditto. --- newlib/ChangeLog | 41 +++++++++++++ newlib/libc/include/wchar.h | 100 +++++++++++++++++++------------- newlib/libc/stdio/fgetws.c | 14 +++-- newlib/libc/stdio/fputws.c | 13 +++-- newlib/libc/stdio/fwprintf.c | 4 +- newlib/libc/stdio/fwscanf.c | 5 +- newlib/libc/stdio/swprintf.c | 15 ++--- newlib/libc/stdio/swscanf.c | 16 ++--- newlib/libc/stdio/vfwprintf.c | 13 +++-- newlib/libc/stdio/vfwscanf.c | 26 +++++---- newlib/libc/stdio/vswprintf.c | 4 +- newlib/libc/stdio/vswscanf.c | 4 +- newlib/libc/stdio/vwprintf.c | 2 +- newlib/libc/stdio/vwscanf.c | 5 +- newlib/libc/stdio/wprintf.c | 2 +- newlib/libc/stdio/wscanf.c | 3 +- newlib/libc/stdlib/mbrlen.c | 2 +- newlib/libc/stdlib/mbrtowc.c | 6 +- newlib/libc/stdlib/mbsnrtowcs.c | 29 ++++----- newlib/libc/stdlib/mbsrtowcs.c | 8 ++- newlib/libc/stdlib/wcrtomb.c | 4 +- newlib/libc/stdlib/wcsnrtombs.c | 29 ++++----- newlib/libc/stdlib/wcsrtombs.c | 8 ++- newlib/libc/stdlib/wcstod.c | 20 ++++--- newlib/libc/stdlib/wcstol.c | 11 ++-- newlib/libc/stdlib/wcstold.c | 2 +- newlib/libc/stdlib/wcstoll.c | 11 ++-- newlib/libc/stdlib/wcstoul.c | 12 ++-- newlib/libc/stdlib/wcstoull.c | 12 ++-- newlib/libc/string/wcpcpy.c | 8 +-- newlib/libc/string/wcpncpy.c | 11 ++-- newlib/libc/string/wcscat.c | 11 ++-- newlib/libc/string/wcscpy.c | 11 ++-- newlib/libc/string/wcsncat.c | 11 ++-- newlib/libc/string/wcsncpy.c | 11 ++-- newlib/libc/string/wcsstr.c | 11 ++-- newlib/libc/string/wcstok.c | 17 +++--- newlib/libc/string/wcsxfrm.c | 11 ++-- newlib/libc/string/wmemcpy.c | 11 ++-- 39 files changed, 316 insertions(+), 218 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index ea1c717b1..75acae2a1 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,44 @@ +2013-11-26 Julio Gutierrez + + *libc/include/wchar.h: Add restrict keyword. + *libc/stdio/fgetws.c (fgetws): ditto. + *libc/stdio/fputws.c (fputws): ditto. + *libc/stdio/fwprintf.c (fwprintf): ditto. + *libc/stdio/fwscanf.c (fwscanf): ditto. + *libc/stdio/swprintf.c (swprintf): ditto. + *libc/stdio/swscanf.c (swscanf): ditto. + *libc/stdio/vfwprintf.c (vfwprintf): ditto. + *libc/stdio/vfwscanf.c (vfwscanf): ditto. + *libc/stdio/vswprintf.c (vswprintf): ditto. + *libc/stdio/vswscanf.c (vswscanf): ditto. + *libc/stdio/vwprintf.c (vwprintf): ditto. + *libc/stdio/vwscanf.c (vwscanf): ditto. + *libc/stdio/wprintf.c (wprintf): ditto. + *libc/stdio/wscanf.c (wscanf): ditto. + *libc/stdlib/mbrlen.c (mbrlen): ditto. + *libc/stdlib/mbrtowc.c (mbrtowc): ditto. + *libc/stdlib/mbsnrtowcs.c (mbsnrtowcs): ditto. + *libc/stdlib/mbsrtowcs.c (mbsrtowcs): ditto. + *libc/stdlib/wcrtomb.c (wcrtomb): ditto. + *libc/stdlib/wcsnrtombs.c (wcsnrtombs): ditto. + *libc/stdlib/wcsrtombs.c (wcsrtombs): ditto. + *libc/stdlib/wcstod.c (wcstod): ditto. + *libc/stdlib/wcstol.c (wcstol): ditto. + *libc/stdlib/wcstold.c (wcstold): ditto. + *libc/stdlib/wcstoll.c (wcstoll): ditto. + *libc/stdlib/wcstoul.c (wcstoul): ditto. + *libc/stdlib/wcstoull.c (cstoull): ditto. + *libc/string/wcpcpy.c (wcpcpy): ditto. + *libc/string/wcpncpy.c (wcpncpy): ditto. + *libc/string/wcscat.c (wcscat): ditto. + *libc/string/wcscpy.c (wcscpy): ditto. + *libc/string/wcsncat.c (wcsncat): ditto. + *libc/string/wcsncpy.c (wcsncpy): ditto. + *libc/string/wcsstr.c (wcsstr): ditto. + *libc/string/wcstok.c (wcstok): ditto. + *libc/string/wcsxfrm.c (wcsxfrm): ditto. + *libc/string/wmemcpy.c (wmemcpy): ditto. + 2013-11-26 Corinna Vinschen * libc/posix/posix_spawn.c: Drop using namespace.h. diff --git a/newlib/libc/include/wchar.h b/newlib/libc/include/wchar.h index 5c991efc9..6f72dcf54 100644 --- a/newlib/libc/include/wchar.h +++ b/newlib/libc/include/wchar.h @@ -49,78 +49,92 @@ typedef _mbstate_t mbstate_t; wint_t _EXFUN(btowc, (int)); int _EXFUN(wctob, (wint_t)); -size_t _EXFUN(mbrlen, (const char * , size_t, mbstate_t *)); -size_t _EXFUN(mbrtowc, (wchar_t * , const char * , size_t, mbstate_t *)); +size_t _EXFUN(mbrlen, (const char *__restrict, size_t, mbstate_t *__restrict)); +size_t _EXFUN(mbrtowc, (wchar_t *__restrict, const char *__restrict, size_t, + mbstate_t *__restrict)); size_t _EXFUN(_mbrtowc_r, (struct _reent *, wchar_t * , const char * , size_t, mbstate_t *)); int _EXFUN(mbsinit, (const mbstate_t *)); -size_t _EXFUN(mbsnrtowcs, (wchar_t * , const char ** , size_t, size_t, - mbstate_t *)); +size_t _EXFUN(mbsnrtowcs, (wchar_t *__restrict, const char **__restrict, + size_t, size_t, mbstate_t *__restrict)); size_t _EXFUN(_mbsnrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, size_t, mbstate_t *)); -size_t _EXFUN(mbsrtowcs, (wchar_t * , const char ** , size_t, mbstate_t *)); +size_t _EXFUN(mbsrtowcs, (wchar_t *__restrict, const char **__restrict, size_t, + mbstate_t *__restrict)); size_t _EXFUN(_mbsrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *)); -size_t _EXFUN(wcrtomb, (char * , wchar_t, mbstate_t *)); +size_t _EXFUN(wcrtomb, (char *__restrict, wchar_t, mbstate_t *__restrict)); size_t _EXFUN(_wcrtomb_r, (struct _reent *, char * , wchar_t, mbstate_t *)); -size_t _EXFUN(wcsnrtombs, (char * , const wchar_t ** , size_t, size_t, - mbstate_t *)); +size_t _EXFUN(wcsnrtombs, (char *__restrict, const wchar_t **__restrict, + size_t, size_t, mbstate_t *__restrict)); size_t _EXFUN(_wcsnrtombs_r, (struct _reent *, char * , const wchar_t ** , size_t, size_t, mbstate_t *)); -size_t _EXFUN(wcsrtombs, (char * , const wchar_t ** , size_t, mbstate_t *)); +size_t _EXFUN(wcsrtombs, (char *__restrict, const wchar_t **__restrict, + size_t, mbstate_t *__restrict)); size_t _EXFUN(_wcsrtombs_r, (struct _reent *, char * , const wchar_t ** , size_t, mbstate_t *)); int _EXFUN(wcscasecmp, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscat, (wchar_t * , const wchar_t *)); +wchar_t *_EXFUN(wcscat, (wchar_t *__restrict, const wchar_t *__restrict)); wchar_t *_EXFUN(wcschr, (const wchar_t *, wchar_t)); int _EXFUN(wcscmp, (const wchar_t *, const wchar_t *)); int _EXFUN(wcscoll, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscpy, (wchar_t * , const wchar_t *)); -wchar_t *_EXFUN(wcpcpy, (wchar_t * , const wchar_t *)); +wchar_t *_EXFUN(wcscpy, (wchar_t *__restrict, const wchar_t *__restrict)); +wchar_t *_EXFUN(wcpcpy, (wchar_t *__restrict, + const wchar_t *__restrict)); wchar_t *_EXFUN(wcsdup, (const wchar_t *)); wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * )); size_t _EXFUN(wcscspn, (const wchar_t *, const wchar_t *)); size_t _EXFUN(wcsftime, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, const struct tm *__restrict)); + const wchar_t *__restrict, const struct tm *__restrict)); size_t _EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t)); size_t _EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t)); size_t _EXFUN(wcslen, (const wchar_t *)); int _EXFUN(wcsncasecmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncat, (wchar_t * , const wchar_t * , size_t)); +wchar_t *_EXFUN(wcsncat, (wchar_t *__restrict, + const wchar_t *__restrict, size_t)); int _EXFUN(wcsncmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncpy, (wchar_t * , const wchar_t * , size_t)); -wchar_t *_EXFUN(wcpncpy, (wchar_t * , const wchar_t * , size_t)); +wchar_t *_EXFUN(wcsncpy, (wchar_t *__restrict, + const wchar_t *__restrict, size_t)); +wchar_t *_EXFUN(wcpncpy, (wchar_t *__restrict, + const wchar_t *__restrict, size_t)); size_t _EXFUN(wcsnlen, (const wchar_t *, size_t)); wchar_t *_EXFUN(wcspbrk, (const wchar_t *, const wchar_t *)); wchar_t *_EXFUN(wcsrchr, (const wchar_t *, wchar_t)); size_t _EXFUN(wcsspn, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsstr, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcstok, (wchar_t *, const wchar_t *, wchar_t **)); -double _EXFUN(wcstod, (const wchar_t *, wchar_t **)); +wchar_t *_EXFUN(wcsstr, (const wchar_t *__restrict, + const wchar_t *__restrict)); +wchar_t *_EXFUN(wcstok, (wchar_t *__restrict, const wchar_t *__restrict, + wchar_t **__restrict)); +double _EXFUN(wcstod, (const wchar_t *__restrict, wchar_t **__restrict)); double _EXFUN(_wcstod_r, (struct _reent *, const wchar_t *, wchar_t **)); -float _EXFUN(wcstof, (const wchar_t *, wchar_t **)); +float _EXFUN(wcstof, (const wchar_t *__restrict, wchar_t **__restrict)); float _EXFUN(_wcstof_r, (struct _reent *, const wchar_t *, wchar_t **)); int _EXFUN(wcswidth, (const wchar_t *, size_t)); -size_t _EXFUN(wcsxfrm, (wchar_t *, const wchar_t *, size_t)); +size_t _EXFUN(wcsxfrm, (wchar_t *__restrict, const wchar_t *__restrict, + size_t)); int _EXFUN(wcwidth, (const wchar_t)); wchar_t *_EXFUN(wmemchr, (const wchar_t *, wchar_t, size_t)); int _EXFUN(wmemcmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemcpy, (wchar_t * , const wchar_t * , size_t)); +wchar_t *_EXFUN(wmemcpy, (wchar_t *__restrict, const wchar_t *__restrict, + size_t)); wchar_t *_EXFUN(wmemmove, (wchar_t *, const wchar_t *, size_t)); wchar_t *_EXFUN(wmemset, (wchar_t *, wchar_t, size_t)); -long _EXFUN(wcstol, (const wchar_t *, wchar_t **, int)); -long long _EXFUN(wcstoll, (const wchar_t *, wchar_t **, int)); -unsigned long _EXFUN(wcstoul, (const wchar_t *, wchar_t **, int)); -unsigned long long _EXFUN(wcstoull, (const wchar_t *, wchar_t **, int)); +long _EXFUN(wcstol, (const wchar_t *__restrict, wchar_t **__restrict, int)); +long long _EXFUN(wcstoll, (const wchar_t *__restrict, wchar_t **__restrict, + int)); +unsigned long _EXFUN(wcstoul, (const wchar_t *__restrict, wchar_t **__restrict, + int)); +unsigned long long _EXFUN(wcstoull, (const wchar_t *__restrict, + wchar_t **__restrict, int)); long _EXFUN(_wcstol_r, (struct _reent *, const wchar_t *, wchar_t **, int)); long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)); unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int)); unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int)); wint_t _EXFUN(fgetwc, (__FILE *)); -wchar_t *_EXFUN(fgetws, (wchar_t *, int, __FILE *)); +wchar_t *_EXFUN(fgetws, (wchar_t *__restrict, int, __FILE *__restrict)); wint_t _EXFUN(fputwc, (wchar_t, __FILE *)); -int _EXFUN(fputws, (const wchar_t *, __FILE *)); +int _EXFUN(fputws, (const wchar_t *__restrict, __FILE *__restrict)); int _EXFUN (fwide, (__FILE *, int)); wint_t _EXFUN (getwc, (__FILE *)); wint_t _EXFUN (getwchar, (void)); @@ -150,12 +164,15 @@ __FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); #endif #endif -int _EXFUN(fwprintf, (__FILE *, const wchar_t *, ...)); -int _EXFUN(swprintf, (wchar_t *, size_t, const wchar_t *, ...)); -int _EXFUN(vfwprintf, (__FILE *, const wchar_t *, __VALIST)); -int _EXFUN(vswprintf, (wchar_t *, size_t, const wchar_t *, __VALIST)); -int _EXFUN(vwprintf, (const wchar_t *, __VALIST)); -int _EXFUN(wprintf, (const wchar_t *, ...)); +int _EXFUN(fwprintf, (__FILE *__restrict, const wchar_t *__restrict, ...)); +int _EXFUN(swprintf, (wchar_t *__restrict, size_t, + const wchar_t *__restrict, ...)); +int _EXFUN(vfwprintf, (__FILE *__restrict, const wchar_t *__restrict, + __VALIST)); +int _EXFUN(vswprintf, (wchar_t *__restrict, size_t, + const wchar_t *__restrict, __VALIST)); +int _EXFUN(vwprintf, (const wchar_t *__restrict, __VALIST)); +int _EXFUN(wprintf, (const wchar_t *__restrict, ...)); int _EXFUN(_fwprintf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); int _EXFUN(_swprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, ...)); @@ -164,12 +181,15 @@ int _EXFUN(_vswprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, _ int _EXFUN(_vwprintf_r, (struct _reent *, const wchar_t *, __VALIST)); int _EXFUN(_wprintf_r, (struct _reent *, const wchar_t *, ...)); -int _EXFUN(fwscanf, (__FILE *, const wchar_t *, ...)); -int _EXFUN(swscanf, (const wchar_t *, const wchar_t *, ...)); -int _EXFUN(vfwscanf, (__FILE *, const wchar_t *, __VALIST)); -int _EXFUN(vswscanf, (const wchar_t *, const wchar_t *, __VALIST)); -int _EXFUN(vwscanf, (const wchar_t *, __VALIST)); -int _EXFUN(wscanf, (const wchar_t *, ...)); +int _EXFUN(fwscanf, (__FILE *__restrict, const wchar_t *__restrict, ...)); +int _EXFUN(swscanf, (const wchar_t *__restrict, + const wchar_t *__restrict, ...)); +int _EXFUN(vfwscanf, (__FILE *__restrict, const wchar_t *__restrict, + __VALIST)); +int _EXFUN(vswscanf, (const wchar_t *__restrict, const wchar_t *__restrict, + __VALIST)); +int _EXFUN(vwscanf, (const wchar_t *__restrict, __VALIST)); +int _EXFUN(wscanf, (const wchar_t *__restrict, ...)); int _EXFUN(_fwscanf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); int _EXFUN(_swscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, ...)); diff --git a/newlib/libc/stdio/fgetws.c b/newlib/libc/stdio/fgetws.c index b5d8851e1..dfd7fe9cc 100644 --- a/newlib/libc/stdio/fgetws.c +++ b/newlib/libc/stdio/fgetws.c @@ -35,17 +35,19 @@ INDEX ANSI_SYNOPSIS #include - wchar_t *fgetws(wchar_t *<[ws]>, int <[n]>, FILE *<[fp]>); + wchar_t *fgetws(wchar_t *__restrict <[ws]>, int <[n]>, + FILE *__restrict <[fp]>); #include - wchar_t *_fgetws_r(struct _reent *<[ptr]>, wchar_t *<[ws]>, int <[n]>, FILE *<[fp]>); + wchar_t *_fgetws_r(struct _reent *<[ptr]>, wchar_t *<[ws]>, + int <[n]>, FILE *<[fp]>); TRAD_SYNOPSIS #include wchar_t *fgetws(<[ws]>,<[n]>,<[fp]>) - wchar_t *<[ws]>; + wchar_t *__restrict <[ws]>; int <[n]>; - FILE *<[fp]>; + FILE *__restrict <[fp]>; #include wchar_t *_fgetws_r(<[ptr]>, <[ws]>,<[n]>,<[fp]>) @@ -156,9 +158,9 @@ error: wchar_t * _DEFUN(fgetws, (ws, n, fp), - wchar_t *ws _AND + wchar_t *__restrict ws _AND int n _AND - FILE *fp) + FILE *__restrict fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fputws.c b/newlib/libc/stdio/fputws.c index a28a5551b..82945996f 100644 --- a/newlib/libc/stdio/fputws.c +++ b/newlib/libc/stdio/fputws.c @@ -35,16 +35,17 @@ INDEX ANSI_SYNOPSIS #include - int fputws(const wchar_t *<[ws]>, FILE *<[fp]>); + int fputws(const wchar_t *__restrict <[ws]>, FILE *__restrict <[fp]>); #include - int _fputws_r(struct _reent *<[ptr]>, const wchar_t *<[ws]>, FILE *<[fp]>); + int _fputws_r(struct _reent *<[ptr]>, const wchar_t *<[ws]>, + FILE *<[fp]>); TRAD_SYNOPSIS #include int fputws(<[ws]>, <[fp]>) - wchar_t *<[ws]>; - FILE *<[fp]>; + wchar_t *__restrict <[ws]>; + FILE *__restrict <[fp]>; #include int _fputws_r(<[ptr]>, <[ws]>, <[fp]>) @@ -142,8 +143,8 @@ error: int _DEFUN(fputws, (ws, fp), - const wchar_t *ws _AND - FILE *fp) + const wchar_t *__restrict ws _AND + FILE *__restrict fp) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/fwprintf.c b/newlib/libc/stdio/fwprintf.c index 76065e965..4b05824c4 100644 --- a/newlib/libc/stdio/fwprintf.c +++ b/newlib/libc/stdio/fwprintf.c @@ -41,8 +41,8 @@ _DEFUN(_fwprintf_r, (ptr, fp, fmt), int _DEFUN(fwprintf, (fp, fmt), - FILE *fp _AND - const wchar_t *fmt _DOTS) + FILE *__restrict fp _AND + const wchar_t *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/fwscanf.c b/newlib/libc/stdio/fwscanf.c index f013cb8f9..8572f4185 100644 --- a/newlib/libc/stdio/fwscanf.c +++ b/newlib/libc/stdio/fwscanf.c @@ -14,7 +14,8 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ - +/* Doc in swscanf.c */ + #include <_ansi.h> #include #include @@ -25,7 +26,7 @@ #ifndef _REENT_ONLY int -fwscanf (FILE *fp, _CONST wchar_t *fmt, ...) +fwscanf (FILE *__restrict fp, _CONST wchar_t *__restrict fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/swprintf.c b/newlib/libc/stdio/swprintf.c index 4e964bedd..60178e52d 100644 --- a/newlib/libc/stdio/swprintf.c +++ b/newlib/libc/stdio/swprintf.c @@ -36,15 +36,16 @@ ANSI_SYNOPSIS #include int wprintf(const wchar_t *<[format]>, ...); - int fwprintf(FILE *<[fd]>, const wchar_t *<[format]>, ...); - int swprintf(wchar_t *<[str]>, size_t <[size]>, - const wchar_t *<[format]>, ...); + int fwprintf(FILE *__restrict <[fd]>, + const wchar_t *__restrict <[format]>, ...); + int swprintf(wchar_t *__restrict <[str]>, size_t <[size]>, + const wchar_t *__restrict <[format]>, ...); int _wprintf_r(struct _reent *<[ptr]>, const wchar_t *<[format]>, ...); int _fwprintf_r(struct _reent *<[ptr]>, FILE *<[fd]>, - const wchar_t *<[format]>, ...); + const wchar_t *<[format]>, ...); int _swprintf_r(struct _reent *<[ptr]>, wchar_t *<[str]>, - size_t <[size]>, const wchar_t *<[format]>, ...); + size_t <[size]>, const wchar_t *<[format]>, ...); DESCRIPTION <> accepts a series of arguments, applies to each a @@ -590,9 +591,9 @@ _DEFUN(_swprintf_r, (ptr, str, size, fmt), int _DEFUN(swprintf, (str, size, fmt), - wchar_t *str _AND + wchar_t *__restrict str _AND size_t size _AND - _CONST wchar_t *fmt _DOTS) + _CONST wchar_t *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/swscanf.c b/newlib/libc/stdio/swscanf.c index 273f59b32..d7ad4b867 100644 --- a/newlib/libc/stdio/swscanf.c +++ b/newlib/libc/stdio/swscanf.c @@ -35,9 +35,11 @@ INDEX ANSI_SYNOPSIS #include - int wscanf(const wchar_t *<[format]>, ...); - int fwscanf(FILE *<[fd]>, const wchar_t *<[format]>, ...); - int swscanf(const wchar_t *<[str]>, const wchar_t *<[format]>, ...); + int wscanf(const wchar_t *__restrict <[format]>, ...); + int fwscanf(FILE *__restrict <[fd]>, + const wchar_t *__restrict <[format]>, ...); + int swscanf(const wchar_t *__restrict <[str]>, + const wchar_t *__restrict <[format]>, ...); int _wscanf_r(struct _reent *<[ptr]>, const wchar_t *<[format]>, ...); int _fwscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>, @@ -50,15 +52,15 @@ TRAD_SYNOPSIS #include int wscanf(<[format]> [, <[arg]>, ...]) - wchar_t *<[format]>; + wchar_t *__restrict <[format]>; int fwscanf(<[fd]>, <[format]> [, <[arg]>, ...]); FILE *<[fd]>; wchar_t *<[format]>; int swscanf(<[str]>, <[format]> [, <[arg]>, ...]); - wchar_t *<[str]>; - wchar_t *<[format]>; + wchar_t *__restrict <[str]>; + wchar_t *__restrict <[format]>; int _wscanf_r(<[ptr]>, <[format]> [, <[arg]>, ...]) struct _reent *<[ptr]>; @@ -378,7 +380,7 @@ Supporting OS subroutines required: <>, <>, <>, #ifndef _REENT_ONLY int -swscanf (_CONST wchar_t *str, _CONST wchar_t *fmt, ...) +swscanf (_CONST wchar_t *__restrict str, _CONST wchar_t *__restrict fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c index 4788add23..c3b8b27bb 100644 --- a/newlib/libc/stdio/vfwprintf.c +++ b/newlib/libc/stdio/vfwprintf.c @@ -51,10 +51,11 @@ ANSI_SYNOPSIS #include #include #include - int vwprintf(const wchar_t *<[fmt]>, va_list <[list]>); - int vfwprintf(FILE *<[fp]>, const wchar_t *<[fmt]>, va_list <[list]>); - int vswprintf(wchar_t *<[str]>, size_t <[size]>, const wchar_t *<[fmt]>, - va_list <[list]>); + int vwprintf(const wchar_t *__restrict <[fmt]>, va_list <[list]>); + int vfwprintf(FILE *__restrict <[fp]>, + const wchar_t *__restrict <[fmt]>, va_list <[list]>); + int vswprintf(wchar_t * __restrict <[str]>, size_t <[size]>, + const wchar_t *__ restrict <[fmt]>, va_list <[list]>); int _vwprintf_r(struct _reent *<[reent]>, const wchar_t *<[fmt]>, va_list <[list]>); @@ -366,8 +367,8 @@ _EXFUN(get_arg, (struct _reent *data, int n, wchar_t *fmt, #ifndef STRING_ONLY int _DEFUN(VFWPRINTF, (fp, fmt0, ap), - FILE * fp _AND - _CONST wchar_t *fmt0 _AND + FILE *__restrict fp _AND + _CONST wchar_t *__restrict fmt0 _AND va_list ap) { int result; diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c index 3379b5e19..d86594ef6 100644 --- a/newlib/libc/stdio/vfwscanf.c +++ b/newlib/libc/stdio/vfwscanf.c @@ -35,14 +35,16 @@ INDEX ANSI_SYNOPSIS #include #include - int vwscanf(const wchar_t *<[fmt]>, va_list <[list]>); - int vfwscanf(FILE *<[fp]>, const wchar_t *<[fmt]>, va_list <[list]>); - int vswscanf(const wchar_t *<[str]>, const wchar_t *<[fmt]>, va_list <[list]>); + int vwscanf(const wchar_t *__restrict <[fmt]>, va_list <[list]>); + int vfwscanf(FILE *__restrict <[fp]>, + const wchar_t *__restrict <[fmt]>, va_list <[list]>); + int vswscanf(const wchar_t *__restrict <[str]>, + const wchar_t *__restrict <[fmt]>, va_list <[list]>); int _vwscanf(struct _reent *<[reent]>, const wchar_t *<[fmt]>, va_list <[list]>); - int _vfwscanf(struct _reent *<[reent]>, FILE *<[fp]>, const wchar_t *<[fmt]>, - va_list <[list]>); + int _vfwscanf(struct _reent *<[reent]>, FILE *<[fp]>, + const wchar_t *<[fmt]>, va_list <[list]>); int _vswscanf(struct _reent *<[reent]>, const wchar_t *<[str]>, const wchar_t *<[fmt]>, va_list <[list]>); @@ -50,17 +52,17 @@ TRAD_SYNOPSIS #include #include int vwscanf( <[fmt]>, <[ist]>) - wchar_t *<[fmt]>; + wchar_t *__restrict <[fmt]>; va_list <[list]>; int vfwscanf( <[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - wchar_t *<[fmt]>; + FILE *__restrict <[fp]>; + wchar_t *__restrict <[fmt]>; va_list <[list]>; int vswscanf( <[str]>, <[fmt]>, <[list]>) - wchar_t *<[str]>; - wchar_t *<[fmt]>; + wchar_t *__restrict <[str]>; + wchar_t *__restrict <[fmt]>; va_list <[list]>; int _vwscanf( <[reent]>, <[fmt]>, <[ist]>) @@ -254,8 +256,8 @@ static void * get_arg (int, va_list *, int *, void **); int _DEFUN(VFWSCANF, (fp, fmt, ap), - register FILE *fp _AND - _CONST wchar_t *fmt _AND + register FILE *__restrict fp _AND + _CONST wchar_t *__restrict fmt _AND va_list ap) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/vswprintf.c b/newlib/libc/stdio/vswprintf.c index 2d9096c15..ac321b662 100644 --- a/newlib/libc/stdio/vswprintf.c +++ b/newlib/libc/stdio/vswprintf.c @@ -71,9 +71,9 @@ _DEFUN(_vswprintf_r, (ptr, str, size, fmt, ap), int _DEFUN(vswprintf, (str, size, fmt, ap), - wchar_t *str _AND + wchar_t *__restrict str _AND size_t size _AND - const wchar_t *fmt _AND + const wchar_t *__restrict fmt _AND va_list ap) { return _vswprintf_r (_REENT, str, size, fmt, ap); diff --git a/newlib/libc/stdio/vswscanf.c b/newlib/libc/stdio/vswscanf.c index 08108173a..0d090f021 100644 --- a/newlib/libc/stdio/vswscanf.c +++ b/newlib/libc/stdio/vswscanf.c @@ -16,6 +16,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +/* Doc in vfwscanf.c */ #include <_ansi.h> #include @@ -36,7 +37,8 @@ #ifndef _REENT_ONLY int -vswscanf (_CONST wchar_t *str, _CONST wchar_t *fmt, va_list ap) +vswscanf (_CONST wchar_t *__restrict str, _CONST wchar_t * __restrict fmt, + va_list ap) { return _vswscanf_r (_REENT, str, fmt, ap); } diff --git a/newlib/libc/stdio/vwprintf.c b/newlib/libc/stdio/vwprintf.c index de95346a0..51d1df3a9 100644 --- a/newlib/libc/stdio/vwprintf.c +++ b/newlib/libc/stdio/vwprintf.c @@ -27,7 +27,7 @@ int _DEFUN(vwprintf, (fmt, ap), - _CONST wchar_t *fmt _AND + _CONST wchar_t *__restrict fmt _AND va_list ap) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/vwscanf.c b/newlib/libc/stdio/vwscanf.c index d0b535170..e40bdede5 100644 --- a/newlib/libc/stdio/vwscanf.c +++ b/newlib/libc/stdio/vwscanf.c @@ -16,7 +16,8 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ - +/* Doc in vfwscanf.c */ + #include <_ansi.h> #include #include @@ -31,7 +32,7 @@ #ifndef _REENT_ONLY int -vwscanf (_CONST wchar_t *fmt, va_list ap) +vwscanf (_CONST wchar_t *__restrict fmt, va_list ap) { struct _reent *reent = _REENT; diff --git a/newlib/libc/stdio/wprintf.c b/newlib/libc/stdio/wprintf.c index 69dea53c6..e05ba1013 100644 --- a/newlib/libc/stdio/wprintf.c +++ b/newlib/libc/stdio/wprintf.c @@ -42,7 +42,7 @@ _DEFUN(_wprintf_r, (ptr, fmt), int _DEFUN(wprintf, (fmt), - const wchar_t *fmt _DOTS) + const wchar_t *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/wscanf.c b/newlib/libc/stdio/wscanf.c index 9fee3c176..f953d9f81 100644 --- a/newlib/libc/stdio/wscanf.c +++ b/newlib/libc/stdio/wscanf.c @@ -14,6 +14,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ + /* Doc in swscanf.c */ #include <_ansi.h> #include @@ -25,7 +26,7 @@ #ifndef _REENT_ONLY int -wscanf(_CONST wchar_t *fmt, ...) +wscanf(_CONST wchar_t *__restrict fmt, ...) { int ret; va_list ap; diff --git a/newlib/libc/stdlib/mbrlen.c b/newlib/libc/stdlib/mbrlen.c index 4319875a1..57a733fed 100644 --- a/newlib/libc/stdlib/mbrlen.c +++ b/newlib/libc/stdlib/mbrlen.c @@ -6,7 +6,7 @@ #include size_t -mbrlen(const char *s, size_t n, mbstate_t *ps) +mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps) { #ifdef _MB_CAPABLE if (ps == NULL) diff --git a/newlib/libc/stdlib/mbrtowc.c b/newlib/libc/stdlib/mbrtowc.c index 0a8c23a9d..550aaff99 100644 --- a/newlib/libc/stdlib/mbrtowc.c +++ b/newlib/libc/stdlib/mbrtowc.c @@ -43,10 +43,10 @@ _DEFUN (_mbrtowc_r, (ptr, pwc, s, n, ps), #ifndef _REENT_ONLY size_t _DEFUN (mbrtowc, (pwc, s, n, ps), - wchar_t *pwc _AND - const char *s _AND + wchar_t *__restrict pwc _AND + const char *__restrict s _AND size_t n _AND - mbstate_t *ps) + mbstate_t *__restrict ps) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) return _mbrtowc_r (_REENT, pwc, s, n, ps); diff --git a/newlib/libc/stdlib/mbsnrtowcs.c b/newlib/libc/stdlib/mbsnrtowcs.c index 6729df951..7ab384721 100644 --- a/newlib/libc/stdlib/mbsnrtowcs.c +++ b/newlib/libc/stdlib/mbsnrtowcs.c @@ -13,8 +13,10 @@ INDEX ANSI_SYNOPSIS #include - size_t mbsrtowcs(wchar_t *<[dst]>, const char **<[src]>, size_t <[len]>, - mbstate_t *<[ps]>); + size_t mbsrtowcs(wchar_t *__restrict <[dst]>, + const char **__restrict <[src]>, + size_t <[len]>, + mbstate_t *__restrict <[ps]>); #include size_t _mbsrtowcs_r(struct _reent *<[ptr]>, wchar_t *<[dst]>, @@ -22,8 +24,9 @@ ANSI_SYNOPSIS mbstate_t *<[ps]>); #include - size_t mbsnrtowcs(wchar_t *<[dst]>, const char **<[src]>, - size_t <[nms]>, size_t <[len]>, mbstate_t *<[ps]>); + size_t mbsnrtowcs(wchar_t *__ restrict <[dst]>, + const char **__restrict <[src]>, size_t <[nms]>, + size_t <[len]>, mbstate_t *__restrict <[ps]>); #include size_t _mbsnrtowcs_r(struct _reent *<[ptr]>, wchar_t *<[dst]>, @@ -33,10 +36,10 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include size_t mbsrtowcs(<[dst]>, <[src]>, <[len]>, <[ps]>) - wchar_t *<[dst]>; - const char **<[src]>; + wchar_t *__restrict <[dst]>; + const char **__restrict <[src]>; size_t <[len]>; - mbstate_t *<[ps]>; + mbstate_t *__restrict <[ps]>; #include size_t _mbsrtowcs_r(<[ptr]>, <[dst]>, <[src]>, <[len]>, <[ps]>) @@ -48,11 +51,11 @@ TRAD_SYNOPSIS #include size_t mbsnrtowcs(<[dst]>, <[src]>, <[nms]>, <[len]>, <[ps]>) - wchar_t *<[dst]>; - const char **<[src]>; + wchar_t *__restrict <[dst]>; + const char **__restrict <[src]>; size_t <[nms]>; size_t <[len]>; - mbstate_t *<[ps]>; + mbstate_t *__restrict <[ps]>; #include size_t _mbsnrtowcs_r(<[ptr]>, <[dst]>, <[src]>, <[nms]>, <[len]>, <[ps]>) @@ -168,11 +171,11 @@ _DEFUN (_mbsnrtowcs_r, (r, dst, src, nms, len, ps), #ifndef _REENT_ONLY size_t _DEFUN (mbsnrtowcs, (dst, src, nms, len, ps), - wchar_t *dst _AND - const char **src _AND + wchar_t *__restrict dst _AND + const char **__restrict src _AND size_t nms _AND size_t len _AND - mbstate_t *ps) + mbstate_t *__restrict ps) { return _mbsnrtowcs_r (_REENT, dst, src, nms, len, ps); } diff --git a/newlib/libc/stdlib/mbsrtowcs.c b/newlib/libc/stdlib/mbsrtowcs.c index d5137d144..65e46d32e 100644 --- a/newlib/libc/stdlib/mbsrtowcs.c +++ b/newlib/libc/stdlib/mbsrtowcs.c @@ -1,3 +1,5 @@ +/* doc in mbsnrtowcs.c */ + #include #include #include @@ -19,10 +21,10 @@ _DEFUN (_mbsrtowcs_r, (r, dst, src, len, ps), #ifndef _REENT_ONLY size_t _DEFUN (mbsrtowcs, (dst, src, len, ps), - wchar_t *dst _AND - const char **src _AND + wchar_t *__restrict dst _AND + const char **__restrict src _AND size_t len _AND - mbstate_t *ps) + mbstate_t *__restrict ps) { return _mbsnrtowcs_r (_REENT, dst, src, (size_t) -1, len, ps); } diff --git a/newlib/libc/stdlib/wcrtomb.c b/newlib/libc/stdlib/wcrtomb.c index b634c23ce..4f3006814 100644 --- a/newlib/libc/stdlib/wcrtomb.c +++ b/newlib/libc/stdlib/wcrtomb.c @@ -42,9 +42,9 @@ _DEFUN (_wcrtomb_r, (ptr, s, wc, ps), #ifndef _REENT_ONLY size_t _DEFUN (wcrtomb, (s, wc, ps), - char *s _AND + char *__restrict s _AND wchar_t wc _AND - mbstate_t *ps) + mbstate_t *__restrict ps) { #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) return _wcrtomb_r (_REENT, s, wc, ps); diff --git a/newlib/libc/stdlib/wcsnrtombs.c b/newlib/libc/stdlib/wcsnrtombs.c index 5f885a454..fa1b2acac 100644 --- a/newlib/libc/stdlib/wcsnrtombs.c +++ b/newlib/libc/stdlib/wcsnrtombs.c @@ -13,8 +13,9 @@ INDEX ANSI_SYNOPSIS #include - size_t wcsrtombs(char *<[dst]>, const wchar_t **<[src]>, size_t <[len]>, - mbstate_t *<[ps]>); + size_t wcsrtombs(char *__restrict <[dst]>, + const wchar_t **__restrict <[src]>, size_t <[len]>, + mbstate_t *__restrict <[ps]>); #include size_t _wcsrtombs_r(struct _reent *<[ptr]>, char *<[dst]>, @@ -22,8 +23,10 @@ ANSI_SYNOPSIS mbstate_t *<[ps]>); #include - size_t wcsnrtombs(char *<[dst]>, const wchar_t **<[src]>, - size_t <[nwc]>, size_t <[len]>, mbstate_t *<[ps]>); + size_t wcsnrtombs(char *__restrict <[dst]>, + const wchar_t **__restrict <[src]>, + size_t <[nwc]>, size_t <[len]>, + mbstate_t *__restrict <[ps]>); #include size_t _wcsnrtombs_r(struct _reent *<[ptr]>, char *<[dst]>, @@ -33,10 +36,10 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include size_t wcsrtombs(<[dst]>, <[src]>, <[len]>, <[ps]>) - char *<[dst]>; - const wchar_t **<[src]>; + char *__restrict <[dst]>; + const wchar_t **__restrict <[src]>; size_t <[len]>; - mbstate_t *<[ps]>; + mbstate_t *__restrict <[ps]>; #include size_t _wcsrtombs_r(<[ptr]>, <[dst]>, <[src]>, <[len]>, <[ps]>) @@ -48,11 +51,11 @@ TRAD_SYNOPSIS #include size_t wcsnrtombs(<[dst]>, <[src]>, <[nwc]>, <[len]>, <[ps]>) - char *<[dst]>; - const wchar_t **<[src]>; + char *__restrict <[dst]>; + const wchar_t **__restrict <[src]>; size_t <[nwc]>; size_t <[len]>; - mbstate_t *<[ps]>; + mbstate_t *__restrict <[ps]>; #include size_t _wcsnrtombs_r(<[ptr]>, <[dst]>, <[src]>, <[nwc]>, <[len]>, <[ps]>) @@ -174,11 +177,11 @@ _DEFUN (_wcsnrtombs_r, (r, dst, src, nwc, len, ps), #ifndef _REENT_ONLY size_t _DEFUN (wcsnrtombs, (dst, src, nwc, len, ps), - char *dst _AND - const wchar_t **src _AND + char *__restrict dst _AND + const wchar_t **__restrict src _AND size_t nwc _AND size_t len _AND - mbstate_t *ps) + mbstate_t *__restrict ps) { return _wcsnrtombs_r (_REENT, dst, src, nwc, len, ps); } diff --git a/newlib/libc/stdlib/wcsrtombs.c b/newlib/libc/stdlib/wcsrtombs.c index ea6bd9d43..2b6777cae 100644 --- a/newlib/libc/stdlib/wcsrtombs.c +++ b/newlib/libc/stdlib/wcsrtombs.c @@ -1,3 +1,5 @@ +/* Doc in wcsnrtombs.c */ + #include #include #include @@ -16,10 +18,10 @@ _DEFUN (_wcsrtombs_r, (r, dst, src, len, ps), #ifndef _REENT_ONLY size_t _DEFUN (wcsrtombs, (dst, src, len, ps), - char *dst _AND - const wchar_t **src _AND + char *__restrict dst _AND + const wchar_t **__restrict src _AND size_t len _AND - mbstate_t *ps) + mbstate_t *__restrict ps) { return _wcsnrtombs_r (_REENT, dst, src, (size_t) -1, len, ps); } diff --git a/newlib/libc/stdlib/wcstod.c b/newlib/libc/stdlib/wcstod.c index d80454c8f..c91ecf2fe 100644 --- a/newlib/libc/stdlib/wcstod.c +++ b/newlib/libc/stdlib/wcstod.c @@ -13,8 +13,10 @@ INDEX ANSI_SYNOPSIS #include - double wcstod(const wchar_t *<[str]>, wchar_t **<[tail]>); - float wcstof(const wchar_t *<[str]>, wchar_t **<[tail]>); + double wcstod(const wchar_t *__restrict <[str]>, + wchar_t **__restrict <[tail]>); + float wcstof(const wchar_t *__restrict <[str]>, + wchar_t **__restrict <[tail]>); double _wcstod_r(void *<[reent]>, const wchar_t *<[str]>, wchar_t **<[tail]>); @@ -24,12 +26,12 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include double wcstod(<[str]>,<[tail]>) - wchar_t *<[str]>; - wchar_t **<[tail]>; + wchar_t *__restrict <[str]>; + wchar_t **__restrict <[tail]>; float wcstof(<[str]>,<[tail]>) - wchar_t *<[str]>; - wchar_t **<[tail]>; + wchar_t *__restrict <[str]>; + wchar_t **__restrict <[tail]>; double _wcstod_r(<[reent]>,<[str]>,<[tail]>) wchar_t *<[reent]>; @@ -211,15 +213,15 @@ _DEFUN (_wcstof_r, (ptr, nptr, endptr), double _DEFUN (wcstod, (nptr, endptr), - _CONST wchar_t *nptr _AND wchar_t **endptr) + _CONST wchar_t *__restrict nptr _AND wchar_t **__restrict endptr) { return _wcstod_r (_REENT, nptr, endptr); } float _DEFUN (wcstof, (nptr, endptr), - _CONST wchar_t *nptr _AND - wchar_t **endptr) + _CONST wchar_t *__restrict nptr _AND + wchar_t **__restrict endptr) { double retval = _wcstod_r (_REENT, nptr, endptr); if (isnan (retval)) diff --git a/newlib/libc/stdlib/wcstol.c b/newlib/libc/stdlib/wcstol.c index e23254dc2..adda9c296 100644 --- a/newlib/libc/stdlib/wcstol.c +++ b/newlib/libc/stdlib/wcstol.c @@ -9,7 +9,8 @@ INDEX ANSI_SYNOPSIS #include - long wcstol(const wchar_t *<[s]>, wchar_t **<[ptr]>,int <[base]>); + long wcstol(const wchar_t *__restrict <[s]>, + wchar_t **__restrict <[ptr]>,int <[base]>); long _wcstol_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>,int <[base]>); @@ -17,8 +18,8 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include long wcstol (<[s]>, <[ptr]>, <[base]>) - wchar_t *<[s]>; - wchar_t **<[ptr]>; + wchar_t *__restrict <[s]>; + wchar_t **__restrict <[ptr]>; int <[base]>; long _wcstol_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) @@ -216,8 +217,8 @@ _DEFUN (_wcstol_r, (rptr, nptr, endptr, base), long _DEFUN (wcstol, (s, ptr, base), - _CONST wchar_t *s _AND - wchar_t **ptr _AND + _CONST wchar_t *__restrict s _AND + wchar_t **__restrict ptr _AND int base) { return _wcstol_r (_REENT, s, ptr, base); diff --git a/newlib/libc/stdlib/wcstold.c b/newlib/libc/stdlib/wcstold.c index 8b0ba2440..0ed0e5a5f 100644 --- a/newlib/libc/stdlib/wcstold.c +++ b/newlib/libc/stdlib/wcstold.c @@ -34,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. /* On platforms where long double is as wide as double. */ #ifdef _LDBL_EQ_DBL long double -wcstold (const wchar_t *nptr, wchar_t **endptr) +wcstold (const wchar_t *__restrict nptr, wchar_t **__restrict endptr) { return wcstod(nptr, endptr); } diff --git a/newlib/libc/stdlib/wcstoll.c b/newlib/libc/stdlib/wcstoll.c index 75eda9f6c..2c36d6d00 100644 --- a/newlib/libc/stdlib/wcstoll.c +++ b/newlib/libc/stdlib/wcstoll.c @@ -9,7 +9,8 @@ INDEX ANSI_SYNOPSIS #include - long long wcstoll(const wchar_t *<[s]>, wchar_t **<[ptr]>,int <[base]>); + long long wcstoll(const wchar_t *__restrict <[s]>, + wchar_t **__restrict <[ptr]>,int <[base]>); long long _wcstoll_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>,int <[base]>); @@ -17,8 +18,8 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include long long wcstoll (<[s]>, <[ptr]>, <[base]>) - const wchar_t *<[s]>; - wchar_t **<[ptr]>; + const wchar_t *__restrict <[s]>; + wchar_t **__restrict <[ptr]>; int <[base]>; long long _wcstoll_r (<[reent]>, <[s]>, <[ptr]>, <[base]>) @@ -128,8 +129,8 @@ No supporting OS subroutines are required. long long _DEFUN (wcstoll, (s, ptr, base), - _CONST wchar_t *s _AND - wchar_t **ptr _AND + _CONST wchar_t *__restrict s _AND + wchar_t **__restrict ptr _AND int base) { return _wcstoll_r (_REENT, s, ptr, base); diff --git a/newlib/libc/stdlib/wcstoul.c b/newlib/libc/stdlib/wcstoul.c index 44dfca399..4b0a95031 100644 --- a/newlib/libc/stdlib/wcstoul.c +++ b/newlib/libc/stdlib/wcstoul.c @@ -9,8 +9,8 @@ INDEX ANSI_SYNOPSIS #include - unsigned long wcstoul(const wchar_t *<[s]>, wchar_t **<[ptr]>, - int <[base]>); + unsigned long wcstoul(const wchar_t *__restrict <[s]>, + wchar_t **__restrict <[ptr]>, int <[base]>); unsigned long _wcstoul_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>, int <[base]>); @@ -18,8 +18,8 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include unsigned long wcstoul(<[s]>, <[ptr]>, <[base]>) - wchar_t *<[s]>; - wchar_t **<[ptr]>; + wchar_t *__restrict <[s]>; + wchar_t **__restrict <[ptr]>; int <[base]>; unsigned long _wcstoul_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) @@ -197,8 +197,8 @@ _DEFUN (_wcstoul_r, (rptr, nptr, endptr, base), unsigned long _DEFUN (wcstoul, (s, ptr, base), - _CONST wchar_t *s _AND - wchar_t **ptr _AND + _CONST wchar_t *__restrict s _AND + wchar_t **__restrict ptr _AND int base) { return _wcstoul_r (_REENT, s, ptr, base); diff --git a/newlib/libc/stdlib/wcstoull.c b/newlib/libc/stdlib/wcstoull.c index 76caadf23..206bb3428 100644 --- a/newlib/libc/stdlib/wcstoull.c +++ b/newlib/libc/stdlib/wcstoull.c @@ -9,8 +9,8 @@ INDEX ANSI_SYNOPSIS #include - unsigned long long wcstoull(const wchar_t *<[s]>, wchar_t **<[ptr]>, - int <[base]>); + unsigned long long wcstoull(const wchar_t *__restrict <[s]>, + wchar_t **__restrict <[ptr]>, int <[base]>); unsigned long long _wcstoull_r(void *<[reent]>, const wchar_t *<[s]>, wchar_t **<[ptr]>, int <[base]>); @@ -18,8 +18,8 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS #include unsigned long long wcstoull(<[s]>, <[ptr]>, <[base]>) - wchar_t *<[s]>; - wchar_t **<[ptr]>; + wchar_t *__restrict <[s]>; + wchar_t **__restrict <[ptr]>; int <[base]>; unsigned long long _wcstoull_r(<[reent]>, <[s]>, <[ptr]>, <[base]>) @@ -130,8 +130,8 @@ PORTABILITY unsigned long long _DEFUN (wcstoull, (s, ptr, base), - _CONST wchar_t *s _AND - wchar_t **ptr _AND + _CONST wchar_t *__restrict s _AND + wchar_t **__restrict ptr _AND int base) { return _wcstoull_r (_REENT, s, ptr, base); diff --git a/newlib/libc/string/wcpcpy.c b/newlib/libc/string/wcpcpy.c index 7bb9a1e9f..ea687abd4 100644 --- a/newlib/libc/string/wcpcpy.c +++ b/newlib/libc/string/wcpcpy.c @@ -8,8 +8,8 @@ ANSI_SYNOPSIS TRAD_SYNOPSIS wchar_t *wcpcpy(<[s1]>, <[s2]> - wchar_t *<[s1]>; - const wchar_t *<[s2]>; + wchar_t *__restrict <[s1]>; + const wchar_t *__restrict <[s2]>; DESCRIPTION The <> function copies the wide-character string pointed to by @@ -32,8 +32,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wcpcpy, (s1, s2), - wchar_t * s1 _AND - _CONST wchar_t * s2) + wchar_t *__restrict s1 _AND + _CONST wchar_t *__restrict s2) { while ((*s1++ = *s2++)) ; diff --git a/newlib/libc/string/wcpncpy.c b/newlib/libc/string/wcpncpy.c index 654bdb78f..87843b422 100644 --- a/newlib/libc/string/wcpncpy.c +++ b/newlib/libc/string/wcpncpy.c @@ -4,12 +4,13 @@ FUNCTION ANSI_SYNOPSIS #include - wchar_t *wcpncpy(wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>); + wchar_t *wcpncpy(wchar_t *__restrict <[s1]>, + const wchar_t *__restrict <[s2]>, size_t <[n]>); TRAD_SYNOPSIS wchar_t *wcpncpy(<[s1]>, <[s2]>, <[n]> - wchar_t *<[s1]>; - const wchar_t *<[s2]>; + wchar_t *__restrict <[s1]>; + const wchar_t *__restrict <[s2]>; size_t <[n]>; DESCRIPTION @@ -39,8 +40,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wcpncpy, (dst, src, count), - wchar_t * dst _AND - _CONST wchar_t * src _AND + wchar_t *__restrict dst _AND + _CONST wchar_t *__restrict src _AND size_t count) { wchar_t *ret = NULL; diff --git a/newlib/libc/string/wcscat.c b/newlib/libc/string/wcscat.c index 54c0b503b..11afbe3a6 100644 --- a/newlib/libc/string/wcscat.c +++ b/newlib/libc/string/wcscat.c @@ -6,12 +6,13 @@ INDEX ANSI_SYNOPSIS #include - wchar_t *wcscat(wchar_t *<[s1]>, const wchar_t *<[s2]>); + wchar_t *wcscat(wchar_t *__restrict <[s1]>, + const wchar_t *__restrict <[s2]>); TRAD_SYNOPSIS wchar_t *wcscat(<[s1]>, <[s2]> - wchar_t *<[s1]>; - const wchar_t *<[s2]>; + wchar_t *__restrict <[s1]>; + const wchar_t *__restrict <[s2]>; DESCRIPTION The <> function appends a copy of the wide-character string @@ -66,8 +67,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wcscat, (s1, s2), - wchar_t * s1 _AND - _CONST wchar_t * s2) + wchar_t *__restrict s1 _AND + _CONST wchar_t *__restrict s2) { wchar_t *p; wchar_t *q; diff --git a/newlib/libc/string/wcscpy.c b/newlib/libc/string/wcscpy.c index ede693d9c..c75866e1d 100644 --- a/newlib/libc/string/wcscpy.c +++ b/newlib/libc/string/wcscpy.c @@ -4,12 +4,13 @@ FUNCTION ANSI_SYNOPSIS #include - wchar_t *wcscpy(wchar_t *<[s1]>, const wchar_t *,<[s2]>); + wchar_t *wcscpy(wchar_t *__restrict <[s1]>, + const wchar_t *__restrict ,<[s2]>); TRAD_SYNOPSIS wchar_t *wcscpy(<[s1]>, <[s2]> - wchar_t *<[s1]>; - const wchar_t *<[s2]>; + wchar_t *__restrict <[s1]>; + const wchar_t *__restrict <[s2]>; DESCRIPTION The <> function copies the wide-character string pointed to by @@ -62,8 +63,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wcscpy, (s1, s2), - wchar_t * s1 _AND - _CONST wchar_t * s2) + wchar_t *__restrict s1 _AND + _CONST wchar_t *__restrict s2) { wchar_t *p; _CONST wchar_t *q; diff --git a/newlib/libc/string/wcsncat.c b/newlib/libc/string/wcsncat.c index fd77c0cc8..b73f6e93e 100644 --- a/newlib/libc/string/wcsncat.c +++ b/newlib/libc/string/wcsncat.c @@ -4,12 +4,13 @@ FUNCTION ANSI_SYNOPSIS #include - wchar_t *wcsncat(wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>); + wchar_t *wcsncat(wchar_t *__restrict <[s1]>, + const wchar_t *__restrict <[s2]>, size_t <[n]>); TRAD_SYNOPSIS wchar_t *wcsncat(<[s1]>, <[s2]>, <[n]> - wchar_t *<[s1]>; - const wchar_t *<[s2]>; + wchar_t *__restrict <[s1]>; + const wchar_t *__restrict <[s2]>; size_t <[n]>; DESCRIPTION @@ -68,8 +69,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wcsncat, (s1, s2, n), - wchar_t * s1 _AND - _CONST wchar_t * s2 _AND + wchar_t *__restrict s1 _AND + _CONST wchar_t *__restrict s2 _AND size_t n) { wchar_t *p; diff --git a/newlib/libc/string/wcsncpy.c b/newlib/libc/string/wcsncpy.c index 533b0ce53..3d6d70b7d 100644 --- a/newlib/libc/string/wcsncpy.c +++ b/newlib/libc/string/wcsncpy.c @@ -4,12 +4,13 @@ FUNCTION ANSI_SYNOPSIS #include - wchar_t *wcsncpy(wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>); + wchar_t *wcsncpy(wchar_t *__restrict <[s1]>, + const wchar_t *__restrict <[s2]>, size_t <[n]>); TRAD_SYNOPSIS wchar_t *wcsncpy(<[s1]>, <[s2]>, <[n]> - wchar_t *<[s1]>; - const wchar_t *<[s2]>; + wchar_t *__restrict <[s1]>; + const wchar_t *__restrict <[s2]>; size_t <[n]>; DESCRIPTION @@ -41,8 +42,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wcsncpy, (s1, s2, n), - wchar_t * s1 _AND - _CONST wchar_t * s2 _AND + wchar_t *__restrict s1 _AND + _CONST wchar_t *__restrict s2 _AND size_t n) { wchar_t *dscan=s1; diff --git a/newlib/libc/string/wcsstr.c b/newlib/libc/string/wcsstr.c index 0b00396ea..6e891120d 100644 --- a/newlib/libc/string/wcsstr.c +++ b/newlib/libc/string/wcsstr.c @@ -4,12 +4,13 @@ FUNCTION ANSI_SYNOPSIS #include - wchar_t *wcsstr(const wchar_t *<[big]>, const wchar_t *<[little]>); + wchar_t *wcsstr(const wchar_t *__restrict <[big]>, + const wchar_t *__restrict <[little]>); TRAD_SYNOPSIS wchar_t *wcsstr(<[big]>, <[little]> - const wchar_t *<[big]>; - const wchar_t *<[little]>; + const wchar_t *__restrict <[big]>; + const wchar_t *__restrict <[little]>; DESCRIPTION The <> function locates the first occurrence in the @@ -66,8 +67,8 @@ PORTABILITY wchar_t * _DEFUN (wcsstr, (big, little), - _CONST wchar_t * big _AND - _CONST wchar_t * little) + _CONST wchar_t *__restrict big _AND + _CONST wchar_t *__restrict little) { _CONST wchar_t *p; _CONST wchar_t *q; diff --git a/newlib/libc/string/wcstok.c b/newlib/libc/string/wcstok.c index de38d3a55..95e9af3c2 100644 --- a/newlib/libc/string/wcstok.c +++ b/newlib/libc/string/wcstok.c @@ -8,15 +8,16 @@ INDEX ANSI_SYNOPSIS #include - wchar_t *wcstok(wchar_t *<[source]>, const wchar_t *<[delimiters]>, - wchar_t **<[lasts]>) + wchar_t *wcstok(wchar_t *__restrict <[source]>, + const wchar_t *__restrict <[delimiters]>, + wchar_t **__restrict <[lasts]>) TRAD_SYNOPSIS #include wchar_t *wcstok(<[source]>, <[delimiters]>, <[lasts]>) - wchar_t *<[source]>; - wchar_t *<[delimiters]>; - wchar_t **<[lasts]>; + wchar_t *__restrict <[source]>; + wchar_t *__restrict <[delimiters]>; + wchar_t **__restrict <[lasts]>; DESCRIPTION The <> function is the wide-character equivalent of the @@ -97,9 +98,9 @@ QUICKREF wchar_t * _DEFUN (wcstok, (s, delim, lasts), - register wchar_t *s _AND - register const wchar_t *delim _AND - wchar_t **lasts) + register wchar_t *__restrict s _AND + register const wchar_t *__restrict delim _AND + wchar_t **__restrict lasts) { register const wchar_t *spanp; register int c, sc; diff --git a/newlib/libc/string/wcsxfrm.c b/newlib/libc/string/wcsxfrm.c index 439bdd036..d5a31728d 100644 --- a/newlib/libc/string/wcsxfrm.c +++ b/newlib/libc/string/wcsxfrm.c @@ -7,13 +7,14 @@ INDEX ANSI_SYNOPSIS #include - int wcsxfrm(wchar_t *<[stra]>, const wchar_t * <[strb]>, size_t <[n]>); + int wcsxfrm(wchar_t *__restrict <[stra]>, + const wchar_t *__restrict <[strb]>, size_t <[n]>); TRAD_SYNOPSIS #include size_t wcsxfrm(<[stra]>, <[strb]>, <[n]>) - wchar_t *<[stra]>; - wchar_t *<[strb]>; + wchar_t *__restrict <[stra]>; + wchar_t *__restrict <[strb]>; size_t <[n]> DESCRIPTION @@ -43,8 +44,8 @@ PORTABILITY size_t _DEFUN (wcsxfrm, (a, b, n), - wchar_t *a _AND - _CONST wchar_t *b _AND + wchar_t *__restrict a _AND + _CONST wchar_t *__restrict b _AND size_t n) { diff --git a/newlib/libc/string/wmemcpy.c b/newlib/libc/string/wmemcpy.c index 748e8e196..a57d6a512 100644 --- a/newlib/libc/string/wmemcpy.c +++ b/newlib/libc/string/wmemcpy.c @@ -4,12 +4,13 @@ FUNCTION ANSI_SYNOPSIS #include - wchar_t *wmemcpy(wchar_t *<[d]>, const wchar_t *<[s]>, size_t <[n]>); + wchar_t *wmemcpy(wchar_t *__restrict <[d]>, + const wchar_t *__restrict <[s]>, size_t <[n]>); TRAD_SYNOPSIS wchar_t *wmemcpy(<[d]>, <[s]>, <[n]> - wchar_t *<[d]>; - const wchar_t *<[s]>; + wchar_t *__restrict <[d]>; + const wchar_t *__restrict <[s]>; size_t <[n]>; DESCRIPTION @@ -67,8 +68,8 @@ No supporting OS subroutines are required. wchar_t * _DEFUN (wmemcpy, (d, s, n), - wchar_t * d _AND - _CONST wchar_t * s _AND + wchar_t *__restrict d _AND + _CONST wchar_t *__restrict s _AND size_t n) { -- 2.43.5