summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-02-19 19:39:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-02-19 19:39:42 +0000
commit3923126b85f9e8a77cab9a41b5a62125acd5b4cd (patch)
tree1a8b19c5db03f8c989fc8228811837b182feb7a3 /lib/libc/stdio
parentcc03bdb70090357d2393b6ec82e3cde4d5ce5edd (diff)
We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/asprintf.c19
-rw-r--r--lib/libc/stdio/fprintf.c17
-rw-r--r--lib/libc/stdio/fscanf.c21
-rw-r--r--lib/libc/stdio/funopen.c6
-rw-r--r--lib/libc/stdio/fvwrite.h6
-rw-r--r--lib/libc/stdio/printf.c16
-rw-r--r--lib/libc/stdio/scanf.c16
-rw-r--r--lib/libc/stdio/snprintf.c18
-rw-r--r--lib/libc/stdio/sprintf.c17
-rw-r--r--lib/libc/stdio/sscanf.c17
-rw-r--r--lib/libc/stdio/vfprintf.c7
-rw-r--r--lib/libc/stdio/vfscanf.c6
12 files changed, 15 insertions, 151 deletions
diff --git a/lib/libc/stdio/asprintf.c b/lib/libc/stdio/asprintf.c
index f08e6c96f42..5aad5df40f2 100644
--- a/lib/libc/stdio/asprintf.c
+++ b/lib/libc/stdio/asprintf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asprintf.c,v 1.7 2001/09/05 22:32:33 deraadt Exp $ */
+/* $OpenBSD: asprintf.c,v 1.8 2002/02/19 19:39:36 millert Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,38 +28,23 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: asprintf.c,v 1.7 2001/09/05 22:32:33 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: asprintf.c,v 1.8 2002/02/19 19:39:36 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
-#if __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
int
-#if __STDC__
asprintf(char **str, char const *fmt, ...)
-#else
-asprintf(str, fmt, va_alist)
- char **str;
- const char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
FILE f;
unsigned char *_base;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
f._file = -1;
f._flags = __SWR | __SSTR | __SALC;
f._bf._base = f._p = (unsigned char *)malloc(128);
diff --git a/lib/libc/stdio/fprintf.c b/lib/libc/stdio/fprintf.c
index 2d7a793c3c4..e2a8b53f3e3 100644
--- a/lib/libc/stdio/fprintf.c
+++ b/lib/libc/stdio/fprintf.c
@@ -35,34 +35,19 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fprintf.c,v 1.3 1997/07/25 20:30:09 mickey Exp $";
+static char rcsid[] = "$OpenBSD: fprintf.c,v 1.4 2002/02/19 19:39:36 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
int
-#ifdef __STDC__
fprintf(FILE *fp, const char *fmt, ...)
-#else
-fprintf(fp, fmt, va_alist)
- FILE *fp;
- char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
ret = vfprintf(fp, fmt, ap);
va_end(ap);
return (ret);
diff --git a/lib/libc/stdio/fscanf.c b/lib/libc/stdio/fscanf.c
index 009dbe8202e..dcd1a9050f5 100644
--- a/lib/libc/stdio/fscanf.c
+++ b/lib/libc/stdio/fscanf.c
@@ -35,34 +35,19 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fscanf.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: fscanf.c,v 1.5 2002/02/19 19:39:36 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
int
-#ifdef __STDC__
-fscanf(FILE *fp, char const *fmt, ...) {
- int ret;
- va_list ap;
-
- va_start(ap, fmt);
-#else
-fscanf(fp, fmt, va_alist)
- FILE *fp;
- char *fmt;
- va_dcl
+fscanf(FILE *fp, char const *fmt, ...)
{
int ret;
va_list ap;
- va_start(ap);
-#endif
+ va_start(ap, fmt);
ret = __svfscanf(fp, fmt, ap);
va_end(ap);
return (ret);
diff --git a/lib/libc/stdio/funopen.c b/lib/libc/stdio/funopen.c
index 6b9eb87d895..c2fcb5461cd 100644
--- a/lib/libc/stdio/funopen.c
+++ b/lib/libc/stdio/funopen.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: funopen.c,v 1.3 1997/07/25 20:30:09 mickey Exp $";
+static char rcsid[] = "$OpenBSD: funopen.c,v 1.4 2002/02/19 19:39:36 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
@@ -46,11 +46,7 @@ FILE *
funopen(cookie, readfn, writefn, seekfn, closefn)
const void *cookie;
int (*readfn)(), (*writefn)();
-#ifdef __STDC__
fpos_t (*seekfn)(void *cookie, fpos_t off, int whence);
-#else
- fpos_t (*seekfn)();
-#endif
int (*closefn)();
{
register FILE *fp;
diff --git a/lib/libc/stdio/fvwrite.h b/lib/libc/stdio/fvwrite.h
index bd7bcde8e9c..013f4abc69f 100644
--- a/lib/libc/stdio/fvwrite.h
+++ b/lib/libc/stdio/fvwrite.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fvwrite.h,v 1.3 1997/07/25 20:30:10 mickey Exp $ */
+/* $OpenBSD: fvwrite.h,v 1.4 2002/02/19 19:39:36 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -49,8 +49,4 @@ struct __suio {
int uio_resid;
};
-#if defined(__STDC__) || defined(c_plusplus)
extern int __sfvwrite(FILE *, struct __suio *);
-#else
-extern int __sfvwrite();
-#endif
diff --git a/lib/libc/stdio/printf.c b/lib/libc/stdio/printf.c
index bdae6aec7ce..bfdacd6a970 100644
--- a/lib/libc/stdio/printf.c
+++ b/lib/libc/stdio/printf.c
@@ -35,33 +35,19 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: printf.c,v 1.3 1997/07/25 20:30:10 mickey Exp $";
+static char rcsid[] = "$OpenBSD: printf.c,v 1.4 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
int
-#ifdef __STDC__
printf(char const *fmt, ...)
-#else
-printf(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
ret = vfprintf(stdout, fmt, ap);
va_end(ap);
return (ret);
diff --git a/lib/libc/stdio/scanf.c b/lib/libc/stdio/scanf.c
index 0897f817979..0efe9150da9 100644
--- a/lib/libc/stdio/scanf.c
+++ b/lib/libc/stdio/scanf.c
@@ -35,33 +35,19 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: scanf.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: scanf.c,v 1.5 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
int
-#ifdef __STDC__
scanf(char const *fmt, ...)
-#else
-scanf(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
ret = __svfscanf(stdin, fmt, ap);
va_end(ap);
return (ret);
diff --git a/lib/libc/stdio/snprintf.c b/lib/libc/stdio/snprintf.c
index 5bd97f0bead..d8d6ccb74d4 100644
--- a/lib/libc/stdio/snprintf.c
+++ b/lib/libc/stdio/snprintf.c
@@ -35,27 +35,15 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: snprintf.c,v 1.6 1998/01/12 06:20:56 millert Exp $";
+static char rcsid[] = "$OpenBSD: snprintf.c,v 1.7 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <limits.h>
#include <stdio.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
int
-#ifdef __STDC__
snprintf(char *str, size_t n, char const *fmt, ...)
-#else
-snprintf(str, n, fmt, va_alist)
- char *str;
- size_t n;
- char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
@@ -64,11 +52,7 @@ snprintf(str, n, fmt, va_alist)
/* While snprintf(3) specifies size_t stdio uses an int internally */
if (n > INT_MAX)
n = INT_MAX;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
f._file = -1;
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
diff --git a/lib/libc/stdio/sprintf.c b/lib/libc/stdio/sprintf.c
index 994192f04bc..c2d757af4c8 100644
--- a/lib/libc/stdio/sprintf.c
+++ b/lib/libc/stdio/sprintf.c
@@ -35,27 +35,16 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sprintf.c,v 1.4 1998/01/12 06:14:31 millert Exp $";
+static char rcsid[] = "$OpenBSD: sprintf.c,v 1.5 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include <limits.h>
#include "local.h"
int
-#ifdef __STDC__
sprintf(char *str, char const *fmt, ...)
-#else
-sprintf(str, fmt, va_alist)
- char *str;
- char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
@@ -65,11 +54,7 @@ sprintf(str, fmt, va_alist)
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = INT_MAX;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
ret = vfprintf(&f, fmt, ap);
va_end(ap);
*f._p = '\0';
diff --git a/lib/libc/stdio/sscanf.c b/lib/libc/stdio/sscanf.c
index f5bee8f9b70..7a9606e3abb 100644
--- a/lib/libc/stdio/sscanf.c
+++ b/lib/libc/stdio/sscanf.c
@@ -35,16 +35,12 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sscanf.c,v 1.4 2001/07/09 06:57:44 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: sscanf.c,v 1.5 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <string.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "local.h"
/* ARGSUSED */
@@ -59,14 +55,7 @@ eofread(cookie, buf, len)
}
int
-#ifdef __STDC__
sscanf(const char *str, char const *fmt, ...)
-#else
-sscanf(str, fmt, va_alist)
- const char *str;
- char *fmt;
- va_dcl
-#endif
{
int ret;
va_list ap;
@@ -78,11 +67,7 @@ sscanf(str, fmt, va_alist)
f._read = eofread;
f._ub._base = NULL;
f._lb._base = NULL;
-#ifdef __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
ret = __svfscanf(&f, fmt, ap);
va_end(ap);
return (ret);
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 326a6e92746..24a9355942b 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: vfprintf.c,v 1.16 2002/02/17 19:42:24 millert Exp $";
+static char *rcsid = "$OpenBSD: vfprintf.c,v 1.17 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -50,12 +50,7 @@ static char *rcsid = "$OpenBSD: vfprintf.c,v 1.16 2002/02/17 19:42:24 millert Ex
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "local.h"
#include "fvwrite.h"
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index cd533cae684..942b37a9d3b 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -35,17 +35,13 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.7 2001/07/09 06:57:45 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.8 2002/02/19 19:39:37 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
-#ifdef __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
#include "local.h"
#ifdef FLOATING_POINT