Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2013-11-18 21:28:06 +0400
committerJoel Sherrill <joel.sherrill@oarcorp.com>2013-11-18 21:28:06 +0400
commit481cb456a484b13e5fba53b86bdbc652227b8e2b (patch)
tree5fec15f7a7e00882113b9b84064a11279f40e120 /newlib/libc/stdio
parent8ab08406dadea2499a556446a0112b9a104cb1d3 (diff)
2013-11-18 Sahil Patnayakuni <sahilp@oarcorp.com>
* 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.
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r--newlib/libc/stdio/asnprintf.c10
-rw-r--r--newlib/libc/stdio/asprintf.c8
-rw-r--r--newlib/libc/stdio/dprintf.c13
-rw-r--r--newlib/libc/stdio/fgetpos.c12
-rw-r--r--newlib/libc/stdio/fgets.c12
-rw-r--r--newlib/libc/stdio/fmemopen.c8
-rw-r--r--newlib/libc/stdio/fopen.c4
-rw-r--r--newlib/libc/stdio/fprintf.c8
-rw-r--r--newlib/libc/stdio/fputs.c12
-rw-r--r--newlib/libc/stdio/fread.c16
-rw-r--r--newlib/libc/stdio/freopen.c20
-rw-r--r--newlib/libc/stdio/fscanf.c4
-rw-r--r--newlib/libc/stdio/fwrite.c14
-rw-r--r--newlib/libc/stdio/printf.c4
-rw-r--r--newlib/libc/stdio/scanf.c4
-rw-r--r--newlib/libc/stdio/setbuf.c4
-rw-r--r--newlib/libc/stdio/snprintf.c8
-rw-r--r--newlib/libc/stdio/sprintf.c46
-rw-r--r--newlib/libc/stdio/sscanf.c28
-rw-r--r--newlib/libc/stdio/vdprintf.c4
-rw-r--r--newlib/libc/stdio/vprintf.c2
-rw-r--r--newlib/libc/stdio/vscanf.c2
-rw-r--r--newlib/libc/stdio/vsnprintf.c8
-rw-r--r--newlib/libc/stdio/vsprintf.c8
-rw-r--r--newlib/libc/stdio/vsscanf.c8
25 files changed, 134 insertions, 133 deletions
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 <stdio.h>
#include <stdarg.h>
- 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
<<dprintf>> and <<vdprintf>> 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 <stdio.h>
- 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 <stdio.h>
@@ -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 <stdio.h>
- char *fgets(char *<[buf]>, int <[n]>, FILE *<[fp]>);
+ char *fgets(char *restrict <[buf]>, int <[n]>, FILE *restrict <[fp]>);
#include <stdio.h>
- 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 <stdio.h>
@@ -83,9 +83,9 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
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 <stdio.h>
- int fputs(const char *<[s]>, FILE *<[fp]>);
+ int fputs(const char *restrict <[s]>, FILE *restrict <[fp]>);
#include <stdio.h>
- 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 <stdio.h>
@@ -74,8 +74,8 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
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 <stdio.h>
- 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 <stdio.h>
- 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 <stdio.h>
@@ -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 <stdio.h>
- 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 <stdio.h>
@@ -90,9 +90,9 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
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 <stdio.h>
- 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 <stdio.h>
- 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 <stdio.h>
@@ -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: <<close>>, <<fstat>>, <<isatty>>,
_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 <stdio.h>
- 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
<<printf>> 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 <stdio.h>
- 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: <<close>>, <<fstat>>, <<isatty>>,
#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;