summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorrobert <robert@FreeBSD.org>2002-08-14 23:45:42 +0000
committerrobert <robert@FreeBSD.org>2002-08-14 23:45:42 +0000
commit4b64f84a432f94425359802d506816872f43c5d7 (patch)
tree4a5ee2a856f08d941a04f571a20db00d3d4f6f88 /lib/libc/stdio
parentf0abd50e99b630b7ce1849ce6d024d7ea4b3bc98 (diff)
downloadFreeBSD-src-4b64f84a432f94425359802d506816872f43c5d7.zip
FreeBSD-src-4b64f84a432f94425359802d506816872f43c5d7.tar.gz
- Add the 'restrict' qualifier to the function definitions and
public prototypes of setbuf(3) and setvbuf(3) using the '__restrict' macro from <sys/cdefs.h> to be compliant with IEEE Std 1003.1-2001. - Replace the K&R with ANSI-C function definitions. - Bring the manual page up-to-date.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/setbuf.34
-rw-r--r--lib/libc/stdio/setbuf.c4
-rw-r--r--lib/libc/stdio/setvbuf.c6
3 files changed, 4 insertions, 10 deletions
diff --git a/lib/libc/stdio/setbuf.3 b/lib/libc/stdio/setbuf.3
index d25f1b8..bfe6487 100644
--- a/lib/libc/stdio/setbuf.3
+++ b/lib/libc/stdio/setbuf.3
@@ -50,13 +50,13 @@
.Sh SYNOPSIS
.In stdio.h
.Ft void
-.Fn setbuf "FILE *stream" "char *buf"
+.Fn setbuf "FILE *restrict stream" "char *restrict buf"
.Ft void
.Fn setbuffer "FILE *stream" "char *buf" "int size"
.Ft int
.Fn setlinebuf "FILE *stream"
.Ft int
-.Fn setvbuf "FILE *stream" "char *buf" "int mode" "size_t size"
+.Fn setvbuf "FILE *restrict stream" "char *restrict buf" "int mode" "size_t size"
.Sh DESCRIPTION
The three types of buffering available are unbuffered, block buffered,
and line buffered.
diff --git a/lib/libc/stdio/setbuf.c b/lib/libc/stdio/setbuf.c
index e6209fd..a1edef4 100644
--- a/lib/libc/stdio/setbuf.c
+++ b/lib/libc/stdio/setbuf.c
@@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$");
#include "local.h"
void
-setbuf(fp, buf)
- FILE *fp;
- char *buf;
+setbuf(FILE *__restrict fp, char *__restrict buf)
{
(void) setvbuf(fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
}
diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c
index df88d24..8be8ff6 100644
--- a/lib/libc/stdio/setvbuf.c
+++ b/lib/libc/stdio/setvbuf.c
@@ -52,11 +52,7 @@ __FBSDID("$FreeBSD$");
* a buffer.
*/
int
-setvbuf(fp, buf, mode, size)
- FILE *fp;
- char *buf;
- int mode;
- size_t size;
+setvbuf(FILE *__restrict fp, char *__restrict buf, int mode, size_t size)
{
int ret, flags;
size_t iosize;
OpenPOWER on IntegriCloud