summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-10-12 16:13:41 +0000
committermike <mike@FreeBSD.org>2002-10-12 16:13:41 +0000
commit4d6bf1c3fb0816347ba09c47c02f040d71c13679 (patch)
tree8937b8185655025519cc44865535915faec9b620 /lib
parentca8c4bef3b2e3511a5dcd4e09b5f4e41a1cb8386 (diff)
downloadFreeBSD-src-4d6bf1c3fb0816347ba09c47c02f040d71c13679.zip
FreeBSD-src-4d6bf1c3fb0816347ba09c47c02f040d71c13679.tar.gz
Add restrict type-qualifier.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/pselect.32
-rw-r--r--lib/libc/gen/pselect.c5
-rw-r--r--lib/libc/stdio/fgetpos.c2
-rw-r--r--lib/libc/stdio/fgets.34
-rw-r--r--lib/libc/stdio/fopen.32
-rw-r--r--lib/libc/stdio/fopen.c4
-rw-r--r--lib/libc/stdio/fputs.c4
-rw-r--r--lib/libc/stdio/fread.34
-rw-r--r--lib/libc/stdio/fread.c4
-rw-r--r--lib/libc/stdio/freopen.c3
-rw-r--r--lib/libc/stdio/fscanf.c2
-rw-r--r--lib/libc/stdio/fseek.32
-rw-r--r--lib/libc/stdio/fwrite.c4
-rw-r--r--lib/libc/stdio/scanf.312
-rw-r--r--lib/libc/stdio/scanf.c2
-rw-r--r--lib/libc/stdio/sscanf.c2
-rw-r--r--lib/libc/stdio/vscanf.c2
-rw-r--r--lib/libc/stdio/vsscanf.c4
18 files changed, 33 insertions, 31 deletions
diff --git a/lib/libc/gen/pselect.3 b/lib/libc/gen/pselect.3
index 6abb952..d09524c 100644
--- a/lib/libc/gen/pselect.3
+++ b/lib/libc/gen/pselect.3
@@ -39,7 +39,7 @@
.Sh SYNOPSIS
.In sys/select.h
.Ft int
-.Fn pselect "int nfds" "fd_set *readfds" "fd_set *writefds" "fd_set *exceptfds" "const struct timespec *timeout" "const sigset_t *newsigmask"
+.Fn pselect "int nfds" "fd_set * restrict readfds" "fd_set * restrict writefds" "fd_set * restrict exceptfds" "const struct timespec * restrict timeout" "const sigset_t * restrict newsigmask"
.Sh DESCRIPTION
The
.Fn pselect
diff --git a/lib/libc/gen/pselect.c b/lib/libc/gen/pselect.c
index c2ec108..28066a2 100644
--- a/lib/libc/gen/pselect.c
+++ b/lib/libc/gen/pselect.c
@@ -47,8 +47,9 @@ __weak_reference(__pselect, pselect);
* and allows the user to specify a signal mask to apply during the select.
*/
int
-__pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds,
- const struct timespec *timo, const sigset_t *mask)
+__pselect(int count, fd_set * __restrict rfds, fd_set * __restrict wfds,
+ fd_set * __restrict efds, const struct timespec * __restrict timo,
+ const sigset_t * __restrict mask)
{
sigset_t omask;
struct timeval tvtimo, *tvp;
diff --git a/lib/libc/stdio/fgetpos.c b/lib/libc/stdio/fgetpos.c
index f5e3aae..295b20a 100644
--- a/lib/libc/stdio/fgetpos.c
+++ b/lib/libc/stdio/fgetpos.c
@@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
int
-fgetpos(FILE *fp, fpos_t *pos)
+fgetpos(FILE * __restrict fp, fpos_t * __restrict pos)
{
/*
* ftello is thread-safe; no need to lock fp.
diff --git a/lib/libc/stdio/fgets.3 b/lib/libc/stdio/fgets.3
index e536b21..7a63039 100644
--- a/lib/libc/stdio/fgets.3
+++ b/lib/libc/stdio/fgets.3
@@ -48,7 +48,7 @@
.Sh SYNOPSIS
.In stdio.h
.Ft char *
-.Fn fgets "char *str" "int size" "FILE *stream"
+.Fn fgets "char * restrict str" "int size" "FILE * restrict stream"
.Ft char *
.Fn gets "char *str"
.Sh DESCRIPTION
@@ -163,4 +163,4 @@ The functions
and
.Fn gets
conform to
-.St -isoC .
+.St -isoC-99 .
diff --git a/lib/libc/stdio/fopen.3 b/lib/libc/stdio/fopen.3
index f4c1f34..a4614d7 100644
--- a/lib/libc/stdio/fopen.3
+++ b/lib/libc/stdio/fopen.3
@@ -49,7 +49,7 @@
.Sh SYNOPSIS
.In stdio.h
.Ft FILE *
-.Fn fopen "const char *path" "const char *mode"
+.Fn fopen "const char * restrict path" "const char * restrict mode"
.Ft FILE *
.Fn fdopen "int fildes" "const char *mode"
.Ft FILE *
diff --git a/lib/libc/stdio/fopen.c b/lib/libc/stdio/fopen.c
index 7af0636..b7c84a7 100644
--- a/lib/libc/stdio/fopen.c
+++ b/lib/libc/stdio/fopen.c
@@ -52,8 +52,8 @@ __FBSDID("$FreeBSD$");
FILE *
fopen(file, mode)
- const char *file;
- const char *mode;
+ const char * __restrict file;
+ const char * __restrict mode;
{
FILE *fp;
int f;
diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c
index e209659..812c37d 100644
--- a/lib/libc/stdio/fputs.c
+++ b/lib/libc/stdio/fputs.c
@@ -53,8 +53,8 @@ __FBSDID("$FreeBSD$");
*/
int
fputs(s, fp)
- const char *s;
- FILE *fp;
+ const char * __restrict s;
+ FILE * __restrict fp;
{
int retval;
struct __suio uio;
diff --git a/lib/libc/stdio/fread.3 b/lib/libc/stdio/fread.3
index 6d4a79c..925ef61 100644
--- a/lib/libc/stdio/fread.3
+++ b/lib/libc/stdio/fread.3
@@ -48,9 +48,9 @@
.Sh SYNOPSIS
.In stdio.h
.Ft size_t
-.Fn fread "void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
+.Fn fread "void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream"
.Ft size_t
-.Fn fwrite "const void *ptr" "size_t size" "size_t nmemb" "FILE *stream"
+.Fn fwrite "const void * restrict ptr" "size_t size" "size_t nmemb" "FILE * restrict stream"
.Sh DESCRIPTION
The function
.Fn fread
diff --git a/lib/libc/stdio/fread.c b/lib/libc/stdio/fread.c
index 39c1a8c..73c7c19 100644
--- a/lib/libc/stdio/fread.c
+++ b/lib/libc/stdio/fread.c
@@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
size_t
fread(buf, size, count, fp)
- void *buf;
+ void * __restrict buf;
size_t size, count;
- FILE *fp;
+ FILE * __restrict fp;
{
size_t resid;
char *p;
diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c
index c885673..b445b15 100644
--- a/lib/libc/stdio/freopen.c
+++ b/lib/libc/stdio/freopen.c
@@ -59,7 +59,8 @@ __FBSDID("$FreeBSD$");
*/
FILE *
freopen(file, mode, fp)
- const char *file, *mode;
+ const char * __restrict file;
+ const char * __restrict mode;
FILE *fp;
{
int f;
diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c
index 1c376a8..ea76af2 100644
--- a/lib/libc/stdio/fscanf.c
+++ b/lib/libc/stdio/fscanf.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
-fscanf(FILE *fp, char const *fmt, ...)
+fscanf(FILE * __restrict fp, char const * __restrict fmt, ...)
{
int ret;
va_list ap;
diff --git a/lib/libc/stdio/fseek.3 b/lib/libc/stdio/fseek.3
index 6326751..f2ca10f 100644
--- a/lib/libc/stdio/fseek.3
+++ b/lib/libc/stdio/fseek.3
@@ -59,7 +59,7 @@
.Ft void
.Fn rewind "FILE *stream"
.Ft int
-.Fn fgetpos "FILE *stream" "fpos_t *pos"
+.Fn fgetpos "FILE * restrict stream" "fpos_t * restrict pos"
.Ft int
.Fn fsetpos "FILE *stream" "const fpos_t *pos"
.In sys/types.h
diff --git a/lib/libc/stdio/fwrite.c b/lib/libc/stdio/fwrite.c
index 445baec..0a74d81 100644
--- a/lib/libc/stdio/fwrite.c
+++ b/lib/libc/stdio/fwrite.c
@@ -53,9 +53,9 @@ __FBSDID("$FreeBSD$");
*/
size_t
fwrite(buf, size, count, fp)
- const void *buf;
+ const void * __restrict buf;
size_t size, count;
- FILE *fp;
+ FILE * __restrict fp;
{
size_t n;
struct __suio uio;
diff --git a/lib/libc/stdio/scanf.3 b/lib/libc/stdio/scanf.3
index af7cc18..ea99c0e 100644
--- a/lib/libc/stdio/scanf.3
+++ b/lib/libc/stdio/scanf.3
@@ -52,18 +52,18 @@
.Sh SYNOPSIS
.In stdio.h
.Ft int
-.Fn scanf "const char *format" ...
+.Fn scanf "const char * restrict format" ...
.Ft int
-.Fn fscanf "FILE *stream" "const char *format" ...
+.Fn fscanf "FILE * restrict stream" "const char * restrict format" ...
.Ft int
-.Fn sscanf "const char *str" "const char *format" ...
+.Fn sscanf "const char * restrict str" "const char * restrict format" ...
.In stdarg.h
.Ft int
-.Fn vscanf "const char *format" "va_list ap"
+.Fn vscanf "const char * restrict format" "va_list ap"
.Ft int
-.Fn vsscanf "const char *str" "const char *format" "va_list ap"
+.Fn vsscanf "const char * restrict str" "const char * restrict format" "va_list ap"
.Ft int
-.Fn vfscanf "FILE *stream" "const char *format" "va_list ap"
+.Fn vfscanf "FILE * restrict stream" "const char * restrict format" "va_list ap"
.Sh DESCRIPTION
The
.Fn scanf
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index 990c9b0..929c20b 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
#include "libc_private.h"
int
-scanf(char const *fmt, ...)
+scanf(char const * __restrict fmt, ...)
{
int ret;
va_list ap;
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index d988326..4db0d29 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -59,7 +59,7 @@ eofread(cookie, buf, len)
}
int
-sscanf(const char *str, char const *fmt, ...)
+sscanf(const char * __restrict str, char const * __restrict fmt, ...)
{
int ret;
va_list ap;
diff --git a/lib/libc/stdio/vscanf.c b/lib/libc/stdio/vscanf.c
index 92f55fc..c3a4266 100644
--- a/lib/libc/stdio/vscanf.c
+++ b/lib/libc/stdio/vscanf.c
@@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$");
int
vscanf(fmt, ap)
- const char *fmt;
+ const char * __restrict fmt;
__va_list ap;
{
int retval;
diff --git a/lib/libc/stdio/vsscanf.c b/lib/libc/stdio/vsscanf.c
index 81a241c..40d4947 100644
--- a/lib/libc/stdio/vsscanf.c
+++ b/lib/libc/stdio/vsscanf.c
@@ -60,8 +60,8 @@ eofread(cookie, buf, len)
int
vsscanf(str, fmt, ap)
- const char *str;
- const char *fmt;
+ const char * __restrict str;
+ const char * __restrict fmt;
__va_list ap;
{
FILE f;
OpenPOWER on IntegriCloud