From 481cb456a484b13e5fba53b86bdbc652227b8e2b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 18 Nov 2013 17:28:06 +0000 Subject: [PATCH] 2013-11-18 Sahil Patnayakuni * libc/include/stdio.h, libc/machine/powerpc/vfscanf.c, libc/machine/spu/fgetpos.c, libc/machine/spu/fgets.c, libc/machine/spu/fopen.c, libc/machine/spu/fputs.c, libc/machine/spu/fread.c, libc/machine/spu/freopen.c, libc/machine/spu/fwrite.c, libc/machine/spu/setbuf.c, libc/machine/spu/vfprintf.c, libc/machine/spu/vfscanf.c, libc/machine/spu/vsnprintf.c, libc/machine/spu/vsprintf.c, libc/machine/spu/vsscanf.c, libc/stdio/asnprintf.c, libc/stdio/asprintf.c, libc/stdio/dprintf.c, libc/stdio/fgetpos.c, libc/stdio/fgets.c, libc/stdio/fmemopen.c, libc/stdio/fopen.c, libc/stdio/fprintf.c, libc/stdio/fputs.c, libc/stdio/fread.c, libc/stdio/freopen.c, libc/stdio/fscanf.c, libc/stdio/fwrite.c, libc/stdio/printf.c, libc/stdio/scanf.c, libc/stdio/setbuf.c, libc/stdio/snprintf.c, libc/stdio/sprintf.c, libc/stdio/sscanf.c, libc/stdio/vdprintf.c, libc/stdio/vprintf.c, libc/stdio/vscanf.c, libc/stdio/vsnprintf.c, libc/stdio/vsprintf.c, libc/stdio/vsscanf.c: Add restrict keyword. --- newlib/ChangeLog | 23 ++++++ newlib/libc/include/stdio.h | 104 +++++++++++++------------- newlib/libc/machine/powerpc/vfscanf.c | 20 ++--- newlib/libc/machine/spu/fgetpos.c | 4 +- newlib/libc/machine/spu/fgets.c | 4 +- newlib/libc/machine/spu/fopen.c | 4 +- newlib/libc/machine/spu/fputs.c | 4 +- newlib/libc/machine/spu/fread.c | 4 +- newlib/libc/machine/spu/freopen.c | 6 +- newlib/libc/machine/spu/fwrite.c | 2 +- newlib/libc/machine/spu/setbuf.c | 4 +- newlib/libc/machine/spu/vfprintf.c | 4 +- newlib/libc/machine/spu/vfscanf.c | 4 +- newlib/libc/machine/spu/vsnprintf.c | 4 +- newlib/libc/machine/spu/vsprintf.c | 4 +- newlib/libc/machine/spu/vsscanf.c | 4 +- newlib/libc/stdio/asnprintf.c | 10 +-- newlib/libc/stdio/asprintf.c | 8 +- newlib/libc/stdio/dprintf.c | 13 ++-- newlib/libc/stdio/fgetpos.c | 12 +-- newlib/libc/stdio/fgets.c | 12 +-- newlib/libc/stdio/fmemopen.c | 8 +- newlib/libc/stdio/fopen.c | 4 +- newlib/libc/stdio/fprintf.c | 8 +- newlib/libc/stdio/fputs.c | 12 +-- newlib/libc/stdio/fread.c | 16 ++-- newlib/libc/stdio/freopen.c | 20 ++--- newlib/libc/stdio/fscanf.c | 4 +- newlib/libc/stdio/fwrite.c | 14 ++-- newlib/libc/stdio/printf.c | 4 +- newlib/libc/stdio/scanf.c | 4 +- newlib/libc/stdio/setbuf.c | 4 +- newlib/libc/stdio/snprintf.c | 8 +- newlib/libc/stdio/sprintf.c | 46 ++++++------ newlib/libc/stdio/sscanf.c | 28 +++---- newlib/libc/stdio/vdprintf.c | 4 +- newlib/libc/stdio/vprintf.c | 2 +- newlib/libc/stdio/vscanf.c | 2 +- newlib/libc/stdio/vsnprintf.c | 8 +- newlib/libc/stdio/vsprintf.c | 8 +- newlib/libc/stdio/vsscanf.c | 8 +- 41 files changed, 245 insertions(+), 221 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1b8fa7385..dc1b1e7fb 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,26 @@ +2013-11-18 Sahil Patnayakuni + + * libc/include/stdio.h, libc/machine/powerpc/vfscanf.c, + libc/machine/spu/fgetpos.c, libc/machine/spu/fgets.c, + libc/machine/spu/fopen.c, libc/machine/spu/fputs.c, + libc/machine/spu/fread.c, libc/machine/spu/freopen.c, + libc/machine/spu/fwrite.c, libc/machine/spu/setbuf.c, + libc/machine/spu/vfprintf.c, libc/machine/spu/vfscanf.c, + libc/machine/spu/vsnprintf.c, libc/machine/spu/vsprintf.c, + libc/machine/spu/vsscanf.c, libc/stdio/asnprintf.c, + libc/stdio/asprintf.c, libc/stdio/dprintf.c, + libc/stdio/fgetpos.c, libc/stdio/fgets.c, + libc/stdio/fmemopen.c, libc/stdio/fopen.c, + libc/stdio/fprintf.c, libc/stdio/fputs.c, + libc/stdio/fread.c, libc/stdio/freopen.c, + libc/stdio/fscanf.c, libc/stdio/fwrite.c, + libc/stdio/printf.c, libc/stdio/scanf.c, + libc/stdio/setbuf.c, libc/stdio/snprintf.c, + libc/stdio/sprintf.c, libc/stdio/sscanf.c, + libc/stdio/vdprintf.c, libc/stdio/vprintf.c, + libc/stdio/vscanf.c, libc/stdio/vsnprintf.c, + libc/stdio/vsprintf.c, libc/stdio/vsscanf.c: Add restrict keyword. + 2013-11-18 Sahil Patnayakuni * libc/include/stdlib.h, libc/stdlib/mbstowcs.c, diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 281b587de..c2418fa31 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -163,29 +163,29 @@ FILE * _EXFUN(tmpfile, (void)); char * _EXFUN(tmpnam, (char *)); int _EXFUN(fclose, (FILE *)); int _EXFUN(fflush, (FILE *)); -FILE * _EXFUN(freopen, (const char *, const char *, FILE *)); -void _EXFUN(setbuf, (FILE *, char *)); -int _EXFUN(setvbuf, (FILE *, char *, int, size_t)); -int _EXFUN(fprintf, (FILE *, const char *, ...) +FILE * _EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict)); +void _EXFUN(setbuf, (FILE *__restrict, char *__restrict)); +int _EXFUN(setvbuf, (FILE *__restrict, char *__restrict, int, size_t)); +int _EXFUN(fprintf, (FILE *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fscanf, (FILE *, const char *, ...) +int _EXFUN(fscanf, (FILE *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(printf, (const char *, ...) +int _EXFUN(printf, (const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(scanf, (const char *, ...) +int _EXFUN(scanf, (const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(sscanf, (const char *, const char *, ...) +int _EXFUN(sscanf, (const char *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(vfprintf, (FILE *, const char *, __VALIST) +int _EXFUN(vfprintf, (FILE *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); int _EXFUN(vprintf, (const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); -int _EXFUN(vsprintf, (char *, const char *, __VALIST) +int _EXFUN(vsprintf, (char *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); int _EXFUN(fgetc, (FILE *)); -char * _EXFUN(fgets, (char *, int, FILE *)); +char * _EXFUN(fgets, (char *__restrict, int, FILE *__restrict)); int _EXFUN(fputc, (int, FILE *)); -int _EXFUN(fputs, (const char *, FILE *)); +int _EXFUN(fputs, (const char *__restrict, FILE *__restrict)); int _EXFUN(getc, (FILE *)); int _EXFUN(getchar, (void)); char * _EXFUN(gets, (char *)); @@ -193,12 +193,12 @@ int _EXFUN(putc, (int, FILE *)); int _EXFUN(putchar, (int)); int _EXFUN(puts, (const char *)); int _EXFUN(ungetc, (int, FILE *)); -size_t _EXFUN(fread, (_PTR, size_t _size, size_t _n, FILE *)); -size_t _EXFUN(fwrite, (const _PTR , size_t _size, size_t _n, FILE *)); +size_t _EXFUN(fread, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); +size_t _EXFUN(fwrite, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); #ifdef _COMPILING_NEWLIB int _EXFUN(fgetpos, (FILE *, _fpos_t *)); #else -int _EXFUN(fgetpos, (FILE *, fpos_t *)); +int _EXFUN(fgetpos, (FILE *__restrict, fpos_t *__restrict)); #endif int _EXFUN(fseek, (FILE *, long, int)); #ifdef _COMPILING_NEWLIB @@ -213,8 +213,8 @@ int _EXFUN(feof, (FILE *)); int _EXFUN(ferror, (FILE *)); void _EXFUN(perror, (const char *)); #ifndef _REENT_ONLY -FILE * _EXFUN(fopen, (const char *_name, const char *_type)); -int _EXFUN(sprintf, (char *, const char *, ...) +FILE * _EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type)); +int _EXFUN(sprintf, (char *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); int _EXFUN(remove, (const char *)); int _EXFUN(rename, (const char *, const char *)); @@ -237,9 +237,9 @@ int _EXFUN(asiprintf, (char **, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(asnprintf, (char *, size_t *, const char *, ...) +char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(asprintf, (char **, const char *, ...) +int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); #ifndef diprintf int _EXFUN(diprintf, (int, const char *, ...) @@ -258,7 +258,7 @@ int _EXFUN(siprintf, (char *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); int _EXFUN(siscanf, (const char *, const char *, ...) _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(snprintf, (char *, size_t, const char *, ...) +int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(sniprintf, (char *, size_t, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); @@ -277,7 +277,7 @@ int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(vfscanf, (FILE *, const char *, __VALIST) +int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); int _EXFUN(viprintf, (const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); @@ -291,9 +291,9 @@ int _EXFUN(vsiscanf, (const char *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vsnprintf, (char *, size_t, const char *, __VALIST) +int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vsscanf, (const char *, const char *, __VALIST) +int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); #endif /* !_REENT_ONLY */ #endif /* !__STRICT_ANSI__ */ @@ -329,17 +329,17 @@ int _EXFUN(putchar_unlocked, (int)); #ifndef __STRICT_ANSI__ # ifndef _REENT_ONLY # ifndef dprintf -int _EXFUN(dprintf, (int, const char *, ...) +int _EXFUN(dprintf, (int, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); # endif -FILE * _EXFUN(fmemopen, (void *, size_t, const char *)); +FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict)); /* getdelim - see __getdelim for now */ /* getline - see __getline for now */ FILE * _EXFUN(open_memstream, (char **, size_t *)); #if defined (__CYGWIN__) int _EXFUN(renameat, (int, const char *, int, const char *)); #endif -int _EXFUN(vdprintf, (int, const char *, __VALIST) +int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); # endif #endif @@ -352,22 +352,22 @@ int _EXFUN(_asiprintf_r, (struct _reent *, char **, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); char * _EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -char * _EXFUN(_asnprintf_r, (struct _reent *, char *, size_t *, const char *, ...) +char * _EXFUN(_asnprintf_r, (struct _reent *, char *__restrict, size_t *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_asprintf_r, (struct _reent *, char **, const char *, ...) +int _EXFUN(_asprintf_r, (struct _reent *, char **__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_dprintf_r, (struct _reent *, int, const char *, ...) +int _EXFUN(_dprintf_r, (struct _reent *, int, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_fclose_r, (struct _reent *, FILE *)); int _EXFUN(_fcloseall_r, (struct _reent *)); FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); int _EXFUN(_fflush_r, (struct _reent *, FILE *)); int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); -char * _EXFUN(_fgets_r, (struct _reent *, char *, int, FILE *)); +char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); #ifdef _COMPILING_NEWLIB -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, _fpos_t *)); +int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); #else int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); @@ -377,23 +377,23 @@ int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *, size_t, const char *)); -FILE * _EXFUN(_fopen_r, (struct _reent *, const char *, const char *)); -FILE * _EXFUN(_freopen_r, (struct _reent *, const char *, const char *, FILE *)); -int _EXFUN(_fprintf_r, (struct _reent *, FILE *, const char *, ...) +FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *__restrict, size_t, const char *__restrict)); +FILE * _EXFUN(_fopen_r, (struct _reent *, const char *__restrict, const char *__restrict)); +FILE * _EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict)); +int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputs_r, (struct _reent *, const char *, FILE *)); -size_t _EXFUN(_fread_r, (struct _reent *, _PTR, size_t _size, size_t _n, FILE *)); -int _EXFUN(_fscanf_r, (struct _reent *, FILE *, const char *, ...) +int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); +size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); +int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); long _EXFUN(_ftell_r, (struct _reent *, FILE *)); _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); void _EXFUN(_rewind_r, (struct _reent *, FILE *)); -size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR , size_t _size, size_t _n, FILE *)); +size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); int _EXFUN(_getc_r, (struct _reent *, FILE *)); int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); int _EXFUN(_getchar_r, (struct _reent *)); @@ -405,7 +405,7 @@ int _EXFUN(_iscanf_r, (struct _reent *, const char *, ...) _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); FILE * _EXFUN(_open_memstream_r, (struct _reent *, char **, size_t *)); void _EXFUN(_perror_r, (struct _reent *, const char *)); -int _EXFUN(_printf_r, (struct _reent *, const char *, ...) +int _EXFUN(_printf_r, (struct _reent *, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); int _EXFUN(_putc_r, (struct _reent *, int, FILE *)); int _EXFUN(_putc_unlocked_r, (struct _reent *, int, FILE *)); @@ -415,7 +415,7 @@ int _EXFUN(_puts_r, (struct _reent *, const char *)); int _EXFUN(_remove_r, (struct _reent *, const char *)); int _EXFUN(_rename_r, (struct _reent *, const char *_old, const char *_new)); -int _EXFUN(_scanf_r, (struct _reent *, const char *, ...) +int _EXFUN(_scanf_r, (struct _reent *, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); int _EXFUN(_siprintf_r, (struct _reent *, char *, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); @@ -423,11 +423,11 @@ int _EXFUN(_siscanf_r, (struct _reent *, const char *, const char *, ...) _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); int _EXFUN(_sniprintf_r, (struct _reent *, char *, size_t, const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_snprintf_r, (struct _reent *, char *, size_t, const char *, ...) +int _EXFUN(_snprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_sprintf_r, (struct _reent *, char *, const char *, ...) +int _EXFUN(_sprintf_r, (struct _reent *, char *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_sscanf_r, (struct _reent *, const char *, const char *, ...) +int _EXFUN(_sscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); char * _EXFUN(_tempnam_r, (struct _reent *, const char *, const char *)); FILE * _EXFUN(_tmpfile_r, (struct _reent *)); @@ -443,23 +443,23 @@ int _EXFUN(_vasprintf_r, (struct _reent *, char **, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); int _EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdprintf_r, (struct _reent *, int, const char *, __VALIST) +int _EXFUN(_vdprintf_r, (struct _reent *, int, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); int _EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); int _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vfprintf_r, (struct _reent *, FILE *, const char *, __VALIST) +int _EXFUN(_vfprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfscanf_r, (struct _reent *, FILE *, const char *, __VALIST) +int _EXFUN(_vfscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); int _EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); int _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vprintf_r, (struct _reent *, const char *, __VALIST) +int _EXFUN(_vprintf_r, (struct _reent *, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_vscanf_r, (struct _reent *, const char *, __VALIST) +int _EXFUN(_vscanf_r, (struct _reent *, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); int _EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); @@ -467,11 +467,11 @@ int _EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); int _EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsnprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST) +int _EXFUN(_vsnprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsprintf_r, (struct _reent *, char *, const char *, __VALIST) +int _EXFUN(_vsprintf_r, (struct _reent *, char *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsscanf_r, (struct _reent *, const char *, const char *, __VALIST) +int _EXFUN(_vsscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, __VALIST) _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); /* Other extensions. */ diff --git a/newlib/libc/machine/powerpc/vfscanf.c b/newlib/libc/machine/powerpc/vfscanf.c index f759506e1..6794f9b7e 100644 --- a/newlib/libc/machine/powerpc/vfscanf.c +++ b/newlib/libc/machine/powerpc/vfscanf.c @@ -12,15 +12,15 @@ INDEX ANSI_SYNOPSIS #include #include - int vscanf(const char *<[fmt]>, va_list <[list]>); - int vfscanf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>); - int vsscanf(const char *<[str]>, const char *<[fmt]>, va_list <[list]>); + int vscanf(const char *restrict <[fmt]>, va_list <[list]>); + int vfscanf(FILE *restrict <[fp]>, const char *restrict <[fmt]>, va_list <[list]>); + int vsscanf(const char *restrict <[str]>, const char *restrict <[fmt]>, va_list <[list]>); - int _vscanf_r(void *<[reent]>, const char *<[fmt]>, + int _vscanf_r(void *<[reent]>, const char *restrict <[fmt]>, va_list <[list]>); - int _vfscanf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>, + int _vfscanf_r(void *<[reent]>, FILE *restrict <[fp]>, const char *restrict <[fmt]>, va_list <[list]>); - int _vsscanf_r(void *<[reent]>, const char *<[str]>, const char *<[fmt]>, + int _vsscanf_r(void *<[reent]>, const char *restrict <[str]>, const char *restrict <[fmt]>, va_list <[list]>); TRAD_SYNOPSIS @@ -218,8 +218,8 @@ typedef union int _DEFUN (vfscanf, (fp, fmt, ap), - register FILE *fp _AND - _CONST char *fmt _AND + register FILE *__restrict fp _AND + _CONST char *__restrict fmt _AND va_list ap) { CHECK_INIT(_REENT, fp); @@ -240,8 +240,8 @@ __svfscanf (fp, fmt0, ap) int _DEFUN (_vfscanf_r, (data, fp, fmt, ap), struct _reent *data _AND - register FILE *fp _AND - _CONST char *fmt _AND + register FILE *__restrict fp _AND + _CONST char *__restrict fmt _AND va_list ap) { return __svfscanf_r (data, fp, fmt, ap); diff --git a/newlib/libc/machine/spu/fgetpos.c b/newlib/libc/machine/spu/fgetpos.c index aa7b6f001..694400e48 100644 --- a/newlib/libc/machine/spu/fgetpos.c +++ b/newlib/libc/machine/spu/fgetpos.c @@ -45,8 +45,8 @@ typedef struct int _DEFUN (fgetpos, (fp, pos), - FILE * fp _AND - _fpos_t * pos) + FILE *__restrict fp _AND + _fpos_t *__restrict pos) { c99_fgetpos_t arg; diff --git a/newlib/libc/machine/spu/fgets.c b/newlib/libc/machine/spu/fgets.c index 8167fd174..2b0ca417e 100644 --- a/newlib/libc/machine/spu/fgets.c +++ b/newlib/libc/machine/spu/fgets.c @@ -47,9 +47,9 @@ typedef struct char * _DEFUN (fgets, (buf, n, fp), - char *buf _AND + char *__restrict buf _AND int n _AND - FILE * fp) + FILE *__restrict fp) { c99_fgets_t args; diff --git a/newlib/libc/machine/spu/fopen.c b/newlib/libc/machine/spu/fopen.c index 20b36678a..821d7c201 100644 --- a/newlib/libc/machine/spu/fopen.c +++ b/newlib/libc/machine/spu/fopen.c @@ -46,8 +46,8 @@ typedef struct #ifndef _REENT_ONLY FILE * _DEFUN (fopen, (file, mode), - _CONST char *file _AND - _CONST char *mode) + _CONST char *__restrict file _AND + _CONST char *__restrict mode) { int ret; c99_fopen_t args; diff --git a/newlib/libc/machine/spu/fputs.c b/newlib/libc/machine/spu/fputs.c index 2b5d17587..9ed796894 100644 --- a/newlib/libc/machine/spu/fputs.c +++ b/newlib/libc/machine/spu/fputs.c @@ -47,8 +47,8 @@ typedef struct int _DEFUN (fputs, (s, fp), - char _CONST * s _AND - FILE * fp) + char _CONST *__restrict s _AND + FILE *__restrict fp) { c99_fputs_t args; diff --git a/newlib/libc/machine/spu/fread.c b/newlib/libc/machine/spu/fread.c index f3c420f76..eb3966c19 100644 --- a/newlib/libc/machine/spu/fread.c +++ b/newlib/libc/machine/spu/fread.c @@ -50,10 +50,10 @@ typedef struct size_t _DEFUN (fread, (buf, size, count, fp), - _PTR buf _AND + _PTR __restrict buf _AND size_t size _AND size_t count _AND - FILE * fp) + FILE *__restrict fp) { c99_fread_t args; diff --git a/newlib/libc/machine/spu/freopen.c b/newlib/libc/machine/spu/freopen.c index 9f19a68f5..53dd2bc1d 100644 --- a/newlib/libc/machine/spu/freopen.c +++ b/newlib/libc/machine/spu/freopen.c @@ -48,9 +48,9 @@ typedef struct FILE * _DEFUN (freopen, (file, mode, fp), - const char *file _AND - const char *mode _AND - FILE *fp) + const char *__restrict file _AND + const char *__restrict mode _AND + FILE *__restrict fp) { int ret; c99_freopen_t args; diff --git a/newlib/libc/machine/spu/fwrite.c b/newlib/libc/machine/spu/fwrite.c index 3804165c8..58aab9f0a 100644 --- a/newlib/libc/machine/spu/fwrite.c +++ b/newlib/libc/machine/spu/fwrite.c @@ -50,7 +50,7 @@ typedef struct size_t _DEFUN (fwrite, (buf, size, count, fp), - _CONST _PTR buf _AND + _CONST _PTR __restrict buf _AND size_t size _AND size_t count _AND FILE * fp) diff --git a/newlib/libc/machine/spu/setbuf.c b/newlib/libc/machine/spu/setbuf.c index 555568154..84430fc73 100644 --- a/newlib/libc/machine/spu/setbuf.c +++ b/newlib/libc/machine/spu/setbuf.c @@ -47,8 +47,8 @@ typedef struct void _DEFUN (setbuf, (fp, buf), - FILE * fp _AND - char *buf) + FILE *__restrict fp _AND + char *__restrict buf) { c99_setbuf_t args; diff --git a/newlib/libc/machine/spu/vfprintf.c b/newlib/libc/machine/spu/vfprintf.c index f46c802b0..128d0b3eb 100644 --- a/newlib/libc/machine/spu/vfprintf.c +++ b/newlib/libc/machine/spu/vfprintf.c @@ -58,8 +58,8 @@ typedef struct int _DEFUN (vfprintf, (fp, fmt0, ap), - FILE * fp _AND - _CONST char *fmt0 _AND + FILE *__restrict fp _AND + _CONST char *__restrict fmt0 _AND va_list ap) { c99_vfprintf_t args; diff --git a/newlib/libc/machine/spu/vfscanf.c b/newlib/libc/machine/spu/vfscanf.c index 4de496b11..0f728969f 100644 --- a/newlib/libc/machine/spu/vfscanf.c +++ b/newlib/libc/machine/spu/vfscanf.c @@ -58,8 +58,8 @@ typedef struct int _DEFUN (vfscanf, (fp, fmt, ap), - FILE *fp _AND - _CONST char *fmt _AND + FILE *__restrict fp _AND + _CONST char *__restrict fmt _AND va_list ap) { c99_vfscanf_t args; diff --git a/newlib/libc/machine/spu/vsnprintf.c b/newlib/libc/machine/spu/vsnprintf.c index 575cf82d2..cf4f5e709 100644 --- a/newlib/libc/machine/spu/vsnprintf.c +++ b/newlib/libc/machine/spu/vsnprintf.c @@ -28,9 +28,9 @@ typedef struct int _DEFUN (vsnprintf, (str, size, fmt, ap), - char *str _AND + char *__restrict str _AND size_t size _AND - _CONST char *fmt _AND + _CONST char *__restrict fmt _AND va_list ap) { c99_vsnprintf_t args; diff --git a/newlib/libc/machine/spu/vsprintf.c b/newlib/libc/machine/spu/vsprintf.c index f69b9400c..0719d38f5 100644 --- a/newlib/libc/machine/spu/vsprintf.c +++ b/newlib/libc/machine/spu/vsprintf.c @@ -27,8 +27,8 @@ typedef struct int _DEFUN (vsprintf, (str, fmt, ap), - char *str _AND - _CONST char *fmt _AND + char *__restrict str _AND + _CONST char *__restrict fmt _AND va_list ap) { c99_vsprintf_t args; diff --git a/newlib/libc/machine/spu/vsscanf.c b/newlib/libc/machine/spu/vsscanf.c index bd76cfc9e..2f7380ff4 100644 --- a/newlib/libc/machine/spu/vsscanf.c +++ b/newlib/libc/machine/spu/vsscanf.c @@ -58,8 +58,8 @@ typedef struct int _DEFUN (vsscanf, (str, fmt, ap), - _CONST char *str _AND - _CONST char *fmt _AND + _CONST char *__restrict str _AND + _CONST char *__restrict fmt _AND va_list ap) { c99_vsscanf_t args; diff --git a/newlib/libc/stdio/asnprintf.c b/newlib/libc/stdio/asnprintf.c index 31e4c7f38..a37c50358 100644 --- a/newlib/libc/stdio/asnprintf.c +++ b/newlib/libc/stdio/asnprintf.c @@ -15,10 +15,10 @@ char * _DEFUN(_asnprintf_r, (ptr, buf, lenp, fmt), - struct _reent *ptr _AND + struct _reent *__restrict ptr _AND char *buf _AND size_t *lenp _AND - const char *fmt _DOTS) + const char *__restrict fmt _DOTS) { int ret; va_list ap; @@ -62,9 +62,9 @@ _DEFUN(_asnprintf_r, (ptr, buf, lenp, fmt), char * _DEFUN(asnprintf, (buf, lenp, fmt), - char *buf _AND - size_t *lenp _AND - const char *fmt _DOTS) + char *__restrict buf _AND + size_t *__restrict lenp _AND + const char *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/asprintf.c b/newlib/libc/stdio/asprintf.c index 7b26d9f29..d04411251 100644 --- a/newlib/libc/stdio/asprintf.c +++ b/newlib/libc/stdio/asprintf.c @@ -27,8 +27,8 @@ int _DEFUN(_asprintf_r, (ptr, strp, fmt), struct _reent *ptr _AND - char **strp _AND - const char *fmt _DOTS) + char **__restrict strp _AND + const char *__restrict fmt _DOTS) { int ret; va_list ap; @@ -54,8 +54,8 @@ _DEFUN(_asprintf_r, (ptr, strp, fmt), int _DEFUN(asprintf, (strp, fmt), - char **strp _AND - const char *fmt _DOTS) + char **__restrict strp _AND + const char *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/dprintf.c b/newlib/libc/stdio/dprintf.c index e2d8b36ca..2271f4b5c 100644 --- a/newlib/libc/stdio/dprintf.c +++ b/newlib/libc/stdio/dprintf.c @@ -19,12 +19,13 @@ INDEX ANSI_SYNOPSIS #include #include - int dprintf(int <[fd]>, const char *<[format]>, ...); - int vdprintf(int <[fd]>, const char *<[format]>, va_list <[ap]>); + int dprintf(int <[fd]>, const char *restrict <[format]>, ...); + int vdprintf(int <[fd]>, const char *restrict <[format]>, + va_list <[ap]>); int _dprintf_r(struct _reent *<[ptr]>, int <[fd]>, - const char *<[format]>, ...); + const char *restrict <[format]>, ...); int _vdprintf_r(struct _reent *<[ptr]>, int <[fd]>, - const char *<[format]>, va_list <[ap]>); + const char *restrict <[format]>, va_list <[ap]>); DESCRIPTION <> and <> allow printing a format, similarly to @@ -55,7 +56,7 @@ int _DEFUN(_dprintf_r, (ptr, fd, format), struct _reent *ptr _AND int fd _AND - const char *format _DOTS) + const char *__restrict format _DOTS) { va_list ap; int n; @@ -71,7 +72,7 @@ _DEFUN(_dprintf_r, (ptr, fd, format), int _DEFUN(dprintf, (fd, format), int fd _AND - const char *format _DOTS) + const char *__restrict format _DOTS) { va_list ap; int n; diff --git a/newlib/libc/stdio/fgetpos.c b/newlib/libc/stdio/fgetpos.c index 21a63789d..20dd1082c 100644 --- a/newlib/libc/stdio/fgetpos.c +++ b/newlib/libc/stdio/fgetpos.c @@ -26,8 +26,8 @@ INDEX ANSI_SYNOPSIS #include - int fgetpos(FILE *<[fp]>, fpos_t *<[pos]>); - int _fgetpos_r(struct _reent *<[ptr]>, FILE *<[fp]>, fpos_t *<[pos]>); + int fgetpos(FILE *restrict <[fp]>, fpos_t *restrict <[pos]>); + int _fgetpos_r(struct _reent *<[ptr]>, FILE *restrict <[fp]>, fpos_t *restrict <[pos]>); TRAD_SYNOPSIS #include @@ -78,8 +78,8 @@ No supporting OS subroutines are required. int _DEFUN(_fgetpos_r, (ptr, fp, pos), struct _reent * ptr _AND - FILE * fp _AND - _fpos_t * pos) + FILE *__restrict fp _AND + _fpos_t *__restrict pos) { *pos = _ftell_r (ptr, fp); @@ -94,8 +94,8 @@ _DEFUN(_fgetpos_r, (ptr, fp, pos), int _DEFUN(fgetpos, (fp, pos), - FILE * fp _AND - _fpos_t * pos) + FILE *__restrict fp _AND + _fpos_t *__restrict pos) { return _fgetpos_r (_REENT, fp, pos); } diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c index 319cfd576..0280ea0c5 100644 --- a/newlib/libc/stdio/fgets.c +++ b/newlib/libc/stdio/fgets.c @@ -26,10 +26,10 @@ INDEX ANSI_SYNOPSIS #include - char *fgets(char *<[buf]>, int <[n]>, FILE *<[fp]>); + char *fgets(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>); #include - char *_fgets_r(struct _reent *<[ptr]>, char *<[buf]>, int <[n]>, FILE *<[fp]>); + char *_fgets_r(struct _reent *<[ptr]>, char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>); TRAD_SYNOPSIS #include @@ -83,9 +83,9 @@ Supporting OS subroutines required: <>, <>, <>, char * _DEFUN(_fgets_r, (ptr, buf, n, fp), struct _reent * ptr _AND - char *buf _AND + char *__restrict buf _AND int n _AND - FILE * fp) + FILE *__restrict fp) { size_t len; char *s; @@ -177,9 +177,9 @@ _DEFUN(_fgets_r, (ptr, buf, n, fp), char * _DEFUN(fgets, (buf, n, fp), - char *buf _AND + char *__restrict buf _AND int n _AND - FILE * fp) + FILE *__restrict fp) { return _fgets_r (_REENT, buf, n, fp); } diff --git a/newlib/libc/stdio/fmemopen.c b/newlib/libc/stdio/fmemopen.c index 44b0c6d1d..17a3c9b5c 100644 --- a/newlib/libc/stdio/fmemopen.c +++ b/newlib/libc/stdio/fmemopen.c @@ -270,9 +270,9 @@ _DEFUN(fmemcloser, (ptr, cookie), FILE * _DEFUN(_fmemopen_r, (ptr, buf, size, mode), struct _reent *ptr _AND - void *buf _AND + void *__restrict buf _AND size_t size _AND - const char *mode) + const char *__restrict mode) { FILE *fp; fmemcookie *c; @@ -362,9 +362,9 @@ _DEFUN(_fmemopen_r, (ptr, buf, size, mode), #ifndef _REENT_ONLY FILE * _DEFUN(fmemopen, (buf, size, mode), - void *buf _AND + void *__restrict buf _AND size_t size _AND - const char *mode) + const char *__restrict mode) { return _fmemopen_r (_REENT, buf, size, mode); } diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c index 27d4bc810..6d07561a3 100644 --- a/newlib/libc/stdio/fopen.c +++ b/newlib/libc/stdio/fopen.c @@ -126,8 +126,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; FILE * _DEFUN(_fopen_r, (ptr, file, mode), struct _reent *ptr _AND - _CONST char *file _AND - _CONST char *mode) + _CONST char *__restrict file _AND + _CONST char *__restrict mode) { register FILE *fp; register int f; diff --git a/newlib/libc/stdio/fprintf.c b/newlib/libc/stdio/fprintf.c index a3c089479..5ea2fd006 100644 --- a/newlib/libc/stdio/fprintf.c +++ b/newlib/libc/stdio/fprintf.c @@ -24,8 +24,8 @@ int _DEFUN(_fprintf_r, (ptr, fp, fmt), struct _reent *ptr _AND - FILE *fp _AND - const char *fmt _DOTS) + FILE *__restrict fp _AND + const char *__restrict fmt _DOTS) { int ret; va_list ap; @@ -40,8 +40,8 @@ _DEFUN(_fprintf_r, (ptr, fp, fmt), int _DEFUN(fprintf, (fp, fmt), - FILE *fp _AND - const char *fmt _DOTS) + FILE *__restrict fp _AND + const char *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c index de6357a05..7c1888f93 100644 --- a/newlib/libc/stdio/fputs.c +++ b/newlib/libc/stdio/fputs.c @@ -26,10 +26,10 @@ INDEX ANSI_SYNOPSIS #include - int fputs(const char *<[s]>, FILE *<[fp]>); + int fputs(const char *restrict <[s]>, FILE *restrict <[fp]>); #include - int _fputs_r(struct _reent *<[ptr]>, const char *<[s]>, FILE *<[fp]>); + int _fputs_r(struct _reent *<[ptr]>, const char *restrict <[s]>, FILE *restrict <[fp]>); TRAD_SYNOPSIS #include @@ -74,8 +74,8 @@ Supporting OS subroutines required: <>, <>, <>, int _DEFUN(_fputs_r, (ptr, s, fp), struct _reent * ptr _AND - char _CONST * s _AND - FILE * fp) + char _CONST *__restrict s _AND + FILE *__restrict fp) { #ifdef _FVWRITE_IN_STREAMIO int result; @@ -122,8 +122,8 @@ error: #ifndef _REENT_ONLY int _DEFUN(fputs, (s, fp), - char _CONST * s _AND - FILE * fp) + char _CONST *__restrict s _AND + FILE *__restrict fp) { return _fputs_r (_REENT, s, fp); } diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c index 07fe0af5c..cf9ab40b7 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -26,12 +26,12 @@ INDEX ANSI_SYNOPSIS #include - size_t fread(void *<[buf]>, size_t <[size]>, size_t <[count]>, - FILE *<[fp]>); + size_t fread(void *restrict <[buf]>, size_t <[size]>, size_t <[count]>, + FILE *restrict <[fp]>); #include - size_t _fread_r(struct _reent *<[ptr]>, void *<[buf]>, - size_t <[size]>, size_t <[count]>, FILE *<[fp]>); + size_t _fread_r(struct _reent *<[ptr]>, void *restrict <[buf]>, + size_t <[size]>, size_t <[count]>, FILE *restrict <[fp]>); TRAD_SYNOPSIS #include @@ -131,10 +131,10 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof), size_t _DEFUN(_fread_r, (ptr, buf, size, count, fp), struct _reent * ptr _AND - _PTR buf _AND + _PTR __restrict buf _AND size_t size _AND size_t count _AND - FILE * fp) + FILE * __restrict fp) { register size_t resid; register char *p; @@ -248,10 +248,10 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), #ifndef _REENT_ONLY size_t _DEFUN(fread, (buf, size, count, fp), - _PTR buf _AND + _PTR __restrict buf _AND size_t size _AND size_t count _AND - FILE * fp) + FILE *__restrict fp) { return _fread_r (_REENT, buf, size, count, fp); } diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index 884e56136..a696a9dd8 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -26,10 +26,10 @@ INDEX ANSI_SYNOPSIS #include - FILE *freopen(const char *<[file]>, const char *<[mode]>, - FILE *<[fp]>); - FILE *_freopen_r(struct _reent *<[ptr]>, const char *<[file]>, - const char *<[mode]>, FILE *<[fp]>); + FILE *freopen(const char *restrict <[file]>, const char *restrict <[mode]>, + FILE *restrict <[fp]>); + FILE *_freopen_r(struct _reent *<[ptr]>, const char *restrict <[file]>, + const char *restrict <[mode]>, FILE *restrict <[fp]>); TRAD_SYNOPSIS #include @@ -90,9 +90,9 @@ Supporting OS subroutines required: <>, <>, <>, FILE * _DEFUN(_freopen_r, (ptr, file, mode, fp), struct _reent *ptr _AND - const char *file _AND - const char *mode _AND - register FILE *fp) + const char *__restrict file _AND + const char *__restrict mode _AND + register FILE *__restrict fp) { register int f; int flags, oflags; @@ -252,9 +252,9 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), FILE * _DEFUN(freopen, (file, mode, fp), - _CONST char *file _AND - _CONST char *mode _AND - register FILE *fp) + _CONST char *__restrict file _AND + _CONST char *__restrict mode _AND + register FILE *__restrict fp) { return _freopen_r (_REENT, file, mode, fp); } diff --git a/newlib/libc/stdio/fscanf.c b/newlib/libc/stdio/fscanf.c index afbc2f0e8..04c9e32f1 100644 --- a/newlib/libc/stdio/fscanf.c +++ b/newlib/libc/stdio/fscanf.c @@ -29,7 +29,7 @@ int #ifdef _HAVE_STDC -fscanf(FILE *fp, _CONST char *fmt, ...) +fscanf(FILE *__restrict fp, _CONST char *__restrict fmt, ...) #else fscanf(FILE *fp, fmt, va_alist) FILE *fp; @@ -54,7 +54,7 @@ fscanf(FILE *fp, fmt, va_alist) int #ifdef _HAVE_STDC -_fscanf_r(struct _reent *ptr, FILE *fp, _CONST char *fmt, ...) +_fscanf_r(struct _reent *ptr, FILE *__restrict fp, _CONST char *__restrict fmt, ...) #else _fscanf_r(ptr, FILE *fp, fmt, va_alist) struct _reent *ptr; diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c index 595e3ef84..f460ae38f 100644 --- a/newlib/libc/stdio/fwrite.c +++ b/newlib/libc/stdio/fwrite.c @@ -26,12 +26,12 @@ INDEX ANSI_SYNOPSIS #include - size_t fwrite(const void *<[buf]>, size_t <[size]>, - size_t <[count]>, FILE *<[fp]>); + size_t fwrite(const void *restrict <[buf]>, size_t <[size]>, + size_t <[count]>, FILE *restrict <[fp]>); #include - size_t _fwrite_r(struct _reent *<[ptr]>, const void *<[buf]>, size_t <[size]>, - size_t <[count]>, FILE *<[fp]>); + size_t _fwrite_r(struct _reent *<[ptr]>, const void *restrict <[buf]>, size_t <[size]>, + size_t <[count]>, FILE *restrict <[fp]>); TRAD_SYNOPSIS #include @@ -97,10 +97,10 @@ static char sccsid[] = "%W% (Berkeley) %G%"; size_t _DEFUN(_fwrite_r, (ptr, buf, size, count, fp), struct _reent * ptr _AND - _CONST _PTR buf _AND + _CONST _PTR __restrict buf _AND size_t size _AND size_t count _AND - FILE * fp) + FILE * __restrict fp) { size_t n; #ifdef _FVWRITE_IN_STREAMIO @@ -158,7 +158,7 @@ ret: #ifndef _REENT_ONLY size_t _DEFUN(fwrite, (buf, size, count, fp), - _CONST _PTR buf _AND + _CONST _PTR __restrict buf _AND size_t size _AND size_t count _AND FILE * fp) diff --git a/newlib/libc/stdio/printf.c b/newlib/libc/stdio/printf.c index 998b6b45b..b9fd6a498 100644 --- a/newlib/libc/stdio/printf.c +++ b/newlib/libc/stdio/printf.c @@ -25,7 +25,7 @@ int _DEFUN(_printf_r, (ptr, fmt), struct _reent *ptr _AND - const char *fmt _DOTS) + const char *__restrict fmt _DOTS) { int ret; va_list ap; @@ -41,7 +41,7 @@ _DEFUN(_printf_r, (ptr, fmt), int _DEFUN(printf, (fmt), - const char *fmt _DOTS) + const char *__restrict fmt _DOTS) { int ret; va_list ap; diff --git a/newlib/libc/stdio/scanf.c b/newlib/libc/stdio/scanf.c index 19c85be4f..84992a558 100644 --- a/newlib/libc/stdio/scanf.c +++ b/newlib/libc/stdio/scanf.c @@ -29,7 +29,7 @@ int #ifdef _HAVE_STDC -scanf(_CONST char *fmt, ...) +scanf(_CONST char *__restrict fmt, ...) #else scanf(fmt, va_alist) char *fmt; @@ -55,7 +55,7 @@ scanf(fmt, va_alist) int #ifdef _HAVE_STDC -_scanf_r(struct _reent *ptr, _CONST char *fmt, ...) +_scanf_r(struct _reent *ptr, _CONST char *__restrict fmt, ...) #else _scanf_r(ptr, fmt, va_alist) struct _reent *ptr; diff --git a/newlib/libc/stdio/setbuf.c b/newlib/libc/stdio/setbuf.c index 1a8bc6de1..cffb6fbf4 100644 --- a/newlib/libc/stdio/setbuf.c +++ b/newlib/libc/stdio/setbuf.c @@ -72,8 +72,8 @@ Supporting OS subroutines required: <>, <>, <>, _VOID _DEFUN(setbuf, (fp, buf), - FILE * fp _AND - char *buf) + FILE *__restrict fp _AND + char *__restrict buf) { _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); } diff --git a/newlib/libc/stdio/snprintf.c b/newlib/libc/stdio/snprintf.c index 13414e3d1..c95e026d5 100644 --- a/newlib/libc/stdio/snprintf.c +++ b/newlib/libc/stdio/snprintf.c @@ -33,9 +33,9 @@ int #ifdef _HAVE_STDC _DEFUN(_snprintf_r, (ptr, str, size, fmt), struct _reent *ptr _AND - char *str _AND + char *__restrict str _AND size_t size _AND - _CONST char *fmt _DOTS) + _CONST char *__restrict fmt _DOTS) #else _snprintf_r(ptr, str, size, fmt, va_alist) struct _reent *ptr; @@ -77,9 +77,9 @@ _snprintf_r(ptr, str, size, fmt, va_alist) int #ifdef _HAVE_STDC _DEFUN(snprintf, (str, size, fmt), - char *str _AND + char *__restrict str _AND size_t size _AND - _CONST char *fmt _DOTS) + _CONST char *__restrict fmt _DOTS) #else snprintf(str, size, fmt, va_alist) char *str; diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c index 0914b23b8..65dcc0fde 100644 --- a/newlib/libc/stdio/sprintf.c +++ b/newlib/libc/stdio/sprintf.c @@ -47,26 +47,26 @@ INDEX ANSI_SYNOPSIS #include - int printf(const char *<[format]>, ...); - int fprintf(FILE *<[fd]>, const char *<[format]>, ...); - int sprintf(char *<[str]>, const char *<[format]>, ...); - int snprintf(char *<[str]>, size_t <[size]>, const char *<[format]>, + int printf(const char *restrict <[format]>, ...); + int fprintf(FILE *restrict <[fd]>, const char *restrict <[format]>, ...); + int sprintf(char *restrict <[str]>, const char *restrict <[format]>, ...); + int snprintf(char *restrict <[str]>, size_t <[size]>, const char *restrict <[format]>, ...); - int asprintf(char **<[strp]>, const char *<[format]>, ...); - char *asnprintf(char *<[str]>, size_t *<[size]>, const char *<[format]>, + int asprintf(char **restrict <[strp]>, const char *restrict <[format]>, ...); + char *asnprintf(char *restrict <[str]>, size_t *restrict <[size]>, const char *restrict <[format]>, ...); - int _printf_r(struct _reent *<[ptr]>, const char *<[format]>, ...); - int _fprintf_r(struct _reent *<[ptr]>, FILE *<[fd]>, - const char *<[format]>, ...); - int _sprintf_r(struct _reent *<[ptr]>, char *<[str]>, - const char *<[format]>, ...); - int _snprintf_r(struct _reent *<[ptr]>, char *<[str]>, size_t <[size]>, - const char *<[format]>, ...); - int _asprintf_r(struct _reent *<[ptr]>, char **<[strp]>, - const char *<[format]>, ...); - char *_asnprintf_r(struct _reent *<[ptr]>, char *<[str]>, - size_t *<[size]>, const char *<[format]>, ...); + int _printf_r(struct _reent *<[ptr]>, const char *restrict <[format]>, ...); + int _fprintf_r(struct _reent *<[ptr]>, FILE *restrict <[fd]>, + const char *restrict <[format]>, ...); + int _sprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>, + const char *restrict <[format]>, ...); + int _snprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>, size_t <[size]>, + const char *restrict <[format]>, ...); + int _asprintf_r(struct _reent *<[ptr]>, char **restrict <[strp]>, + const char *restrict <[format]>, ...); + char *_asnprintf_r(struct _reent *<[ptr]>, char *restrict <[str]>, + size_t *restrict <[size]>, const char *restrict <[format]>, ...); DESCRIPTION <> accepts a series of arguments, applies to each a @@ -579,13 +579,13 @@ int #ifdef _HAVE_STDC _DEFUN(_sprintf_r, (ptr, str, fmt), struct _reent *ptr _AND - char *str _AND - _CONST char *fmt _DOTS) + char *__restrict str _AND + _CONST char *__restrict fmt _DOTS) #else _sprintf_r(ptr, str, fmt, va_alist) struct _reent *ptr; - char *str; - _CONST char *fmt; + char *__restrict str; + _CONST char *__restrict fmt; va_dcl #endif { @@ -613,8 +613,8 @@ _sprintf_r(ptr, str, fmt, va_alist) int #ifdef _HAVE_STDC _DEFUN(sprintf, (str, fmt), - char *str _AND - _CONST char *fmt _DOTS) + char *__restrict str _AND + _CONST char *__restrict fmt _DOTS) #else sprintf(str, fmt, va_alist) char *str; diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c index 974ae812b..e08002ea2 100644 --- a/newlib/libc/stdio/sscanf.c +++ b/newlib/libc/stdio/sscanf.c @@ -35,15 +35,15 @@ INDEX ANSI_SYNOPSIS #include - int scanf(const char *<[format]>, ...); - int fscanf(FILE *<[fd]>, const char *<[format]>, ...); - int sscanf(const char *<[str]>, const char *<[format]>, ...); + int scanf(const char *restrict <[format]>, ...); + int fscanf(FILE *restrict <[fd]>, const char *restrict <[format]>, ...); + int sscanf(const char *restrict <[str]>, const char *restrict <[format]>, ...); - int _scanf_r(struct _reent *<[ptr]>, const char *<[format]>, ...); - int _fscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>, - const char *<[format]>, ...); - int _sscanf_r(struct _reent *<[ptr]>, const char *<[str]>, - const char *<[format]>, ...); + int _scanf_r(struct _reent *<[ptr]>, const char *restrict <[format]>, ...); + int _fscanf_r(struct _reent *<[ptr]>, FILE *restrict <[fd]>, + const char *restrict <[format]>, ...); + int _sscanf_r(struct _reent *<[ptr]>, const char *restrict <[str]>, + const char *restrict <[format]>, ...); TRAD_SYNOPSIS @@ -399,8 +399,8 @@ Supporting OS subroutines required: <>, <>, <>, #ifdef _HAVE_STDC int _DEFUN(sscanf, (str, fmt), - _CONST char *str _AND - _CONST char *fmt _DOTS) + _CONST char *__restrict str _AND + _CONST char * fmt _DOTS) #else int sscanf(str, fmt, va_alist) @@ -436,14 +436,14 @@ sscanf(str, fmt, va_alist) int _DEFUN(_sscanf_r, (ptr, str, fmt), struct _reent *ptr _AND - _CONST char *str _AND - _CONST char *fmt _DOTS) + _CONST char *__restrict str _AND + _CONST char *__restrict fmt _DOTS) #else int _sscanf_r(ptr, str, fmt, va_alist) struct _reent *ptr; - _CONST char *str; - _CONST char *fmt; + _CONST char *__restrict str; + _CONST char *__restrict fmt; va_dcl #endif { diff --git a/newlib/libc/stdio/vdprintf.c b/newlib/libc/stdio/vdprintf.c index bfb19c95b..7e875ac32 100644 --- a/newlib/libc/stdio/vdprintf.c +++ b/newlib/libc/stdio/vdprintf.c @@ -16,7 +16,7 @@ int _DEFUN(_vdprintf_r, (ptr, fd, format, ap), struct _reent *ptr _AND int fd _AND - const char *format _AND + const char *__restrict format _AND va_list ap) { char *p; @@ -38,7 +38,7 @@ _DEFUN(_vdprintf_r, (ptr, fd, format, ap), int _DEFUN(vdprintf, (fd, format, ap), int fd _AND - const char *format _AND + const char *__restrict format _AND va_list ap) { return _vdprintf_r (_REENT, fd, format, ap); diff --git a/newlib/libc/stdio/vprintf.c b/newlib/libc/stdio/vprintf.c index 375656972..581efeb2e 100644 --- a/newlib/libc/stdio/vprintf.c +++ b/newlib/libc/stdio/vprintf.c @@ -44,7 +44,7 @@ _DEFUN(vprintf, (fmt, ap), int _DEFUN(_vprintf_r, (ptr, fmt, ap), struct _reent *ptr _AND - _CONST char *fmt _AND + _CONST char *__restrict fmt _AND va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); diff --git a/newlib/libc/stdio/vscanf.c b/newlib/libc/stdio/vscanf.c index 210774b05..74b148d44 100644 --- a/newlib/libc/stdio/vscanf.c +++ b/newlib/libc/stdio/vscanf.c @@ -45,7 +45,7 @@ _DEFUN(vscanf, (fmt, ap), int _DEFUN(_vscanf_r, (ptr, fmt, ap), struct _reent *ptr _AND - _CONST char *fmt _AND + _CONST char *__restrict fmt _AND va_list ap) { _REENT_SMALL_CHECK_INIT (ptr); diff --git a/newlib/libc/stdio/vsnprintf.c b/newlib/libc/stdio/vsnprintf.c index 58106b676..d9f1e3dfd 100644 --- a/newlib/libc/stdio/vsnprintf.c +++ b/newlib/libc/stdio/vsnprintf.c @@ -33,9 +33,9 @@ static char sccsid[] = "%W% (Berkeley) %G%"; int _DEFUN(vsnprintf, (str, size, fmt, ap), - char *str _AND + char *__restrict str _AND size_t size _AND - const char *fmt _AND + const char *__restrict fmt _AND va_list ap) { return _vsnprintf_r (_REENT, str, size, fmt, ap); @@ -46,9 +46,9 @@ _DEFUN(vsnprintf, (str, size, fmt, ap), int _DEFUN(_vsnprintf_r, (ptr, str, size, fmt, ap), struct _reent *ptr _AND - char *str _AND + char *__restrict str _AND size_t size _AND - const char *fmt _AND + const char *__restrict fmt _AND va_list ap) { int ret; diff --git a/newlib/libc/stdio/vsprintf.c b/newlib/libc/stdio/vsprintf.c index 9ab0c73a1..8bc99321e 100644 --- a/newlib/libc/stdio/vsprintf.c +++ b/newlib/libc/stdio/vsprintf.c @@ -32,8 +32,8 @@ static char sccsid[] = "%W% (Berkeley) %G%"; int _DEFUN(vsprintf, (str, fmt, ap), - char *str _AND - const char *fmt _AND + char *__restrict str _AND + const char *__restrict fmt _AND va_list ap) { return _vsprintf_r (_REENT, str, fmt, ap); @@ -44,8 +44,8 @@ _DEFUN(vsprintf, (str, fmt, ap), int _DEFUN(_vsprintf_r, (ptr, str, fmt, ap), struct _reent *ptr _AND - char *str _AND - const char *fmt _AND + char *__restrict str _AND + const char *__restrict fmt _AND va_list ap) { int ret; diff --git a/newlib/libc/stdio/vsscanf.c b/newlib/libc/stdio/vsscanf.c index 2b9aeaf5b..a6d0793b1 100644 --- a/newlib/libc/stdio/vsscanf.c +++ b/newlib/libc/stdio/vsscanf.c @@ -36,8 +36,8 @@ int _DEFUN(vsscanf, (str, fmt, ap), - _CONST char *str _AND - _CONST char *fmt _AND + _CONST char *__restrict str _AND + _CONST char *__restrict fmt _AND va_list ap) { return _vsscanf_r (_REENT, str, fmt, ap); @@ -48,8 +48,8 @@ _DEFUN(vsscanf, (str, fmt, ap), int _DEFUN(_vsscanf_r, (ptr, str, fmt, ap), struct _reent *ptr _AND - _CONST char *str _AND - _CONST char *fmt _AND + _CONST char *__restrict str _AND + _CONST char *__restrict fmt _AND va_list ap) { FILE f;