summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2001-03-05 11:27:49 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2001-03-05 11:27:49 +0000
commit23bf17ef09710efb1c23a33846c75dc1d8acc213 (patch)
treed1ef6ce800a5b19a80d1a8eda0ced32f5d85a6c3 /lib/libc/stdio
parent1cb60e524c21b92c86a798f5c67317a1a171a970 (diff)
Notes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/fwalk.c9
-rw-r--r--lib/libc/stdio/getc.c3
-rw-r--r--lib/libc/stdio/local.h2
-rw-r--r--lib/libc/stdio/makebuf.c2
-rw-r--r--lib/libc/stdio/perror.c2
-rw-r--r--lib/libc/stdio/refill.c3
-rw-r--r--lib/libc/stdio/rewind.c5
-rw-r--r--lib/libc/stdio/rget.c9
-rw-r--r--lib/libc/stdio/ungetc.c11
-rw-r--r--lib/libc/stdio/vfprintf.c79
-rw-r--r--lib/libc/stdio/vfscanf.c19
11 files changed, 55 insertions, 89 deletions
diff --git a/lib/libc/stdio/fwalk.c b/lib/libc/stdio/fwalk.c
index b1a25d1f8707..670e32b6cb1d 100644
--- a/lib/libc/stdio/fwalk.c
+++ b/lib/libc/stdio/fwalk.c
@@ -42,18 +42,17 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* LIBC_SCCS and not lint */
-#include <errno.h>
#include <stdio.h>
#include "local.h"
#include "glue.h"
int
_fwalk(function)
- register int (*function)(FILE *);
+ int (*function)(FILE *);
{
- register FILE *fp;
- register int n, ret;
- register struct glue *g;
+ FILE *fp;
+ int n, ret;
+ struct glue *g;
ret = 0;
for (g = &__sglue; g != NULL; g = g->next)
diff --git a/lib/libc/stdio/getc.c b/lib/libc/stdio/getc.c
index eff320aa432d..54c850eb1773 100644
--- a/lib/libc/stdio/getc.c
+++ b/lib/libc/stdio/getc.c
@@ -51,8 +51,7 @@ static const char rcsid[] =
#undef getc
int
-getc(fp)
- register FILE *fp;
+getc(FILE *fp)
{
int retval;
FLOCKFILE(fp);
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h
index cbc07a9d727b..e0556e0addc3 100644
--- a/lib/libc/stdio/local.h
+++ b/lib/libc/stdio/local.h
@@ -34,6 +34,8 @@
* SUCH DAMAGE.
*
* @(#)local.h 8.3 (Berkeley) 7/3/94
+ *
+ * $FreeBSD$
*/
/*
diff --git a/lib/libc/stdio/makebuf.c b/lib/libc/stdio/makebuf.c
index 7dcbd70e0f6e..9c697269f15a 100644
--- a/lib/libc/stdio/makebuf.c
+++ b/lib/libc/stdio/makebuf.c
@@ -32,6 +32,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
diff --git a/lib/libc/stdio/perror.c b/lib/libc/stdio/perror.c
index bb618247e96f..0f613733e3f8 100644
--- a/lib/libc/stdio/perror.c
+++ b/lib/libc/stdio/perror.c
@@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c
index 87938302157f..d4eb78b47a94 100644
--- a/lib/libc/stdio/refill.c
+++ b/lib/libc/stdio/refill.c
@@ -50,8 +50,7 @@ static const char rcsid[] =
static int lflush __P((FILE *));
static int
-lflush(fp)
- FILE *fp;
+lflush(FILE *fp)
{
if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
diff --git a/lib/libc/stdio/rewind.c b/lib/libc/stdio/rewind.c
index 98c5846306bb..dec890531cce 100644
--- a/lib/libc/stdio/rewind.c
+++ b/lib/libc/stdio/rewind.c
@@ -47,12 +47,11 @@ static const char rcsid[] =
#include "libc_private.h"
void
-rewind(fp)
- register FILE *fp;
+rewind(FILE *fp)
{
FLOCKFILE(fp);
(void) fseek(fp, 0L, SEEK_SET);
clearerr(fp);
FUNLOCKFILE(fp);
- errno = 0; /* not required, but seems reasonable */
+ errno = 0; /* not required, but seems reasonable */
}
diff --git a/lib/libc/stdio/rget.c b/lib/libc/stdio/rget.c
index 45d817d78f9e..030d410e253e 100644
--- a/lib/libc/stdio/rget.c
+++ b/lib/libc/stdio/rget.c
@@ -39,22 +39,19 @@
static char sccsid[] = "@(#)rget.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id";
+ "$FreeBSD$";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
#include "local.h"
-int
-__srefill(FILE *);
-
/*
* Handle getc() when the buffer ran out:
* Refill, then return the first character
* in the newly-filled buffer.
*/
-int __srget(fp)
- register FILE *fp;
+int
+__srget(FILE *fp)
{
if (__srefill(fp) == 0) {
fp->_r--;
diff --git a/lib/libc/stdio/ungetc.c b/lib/libc/stdio/ungetc.c
index 3f4b32cb4313..3295ae06336d 100644
--- a/lib/libc/stdio/ungetc.c
+++ b/lib/libc/stdio/ungetc.c
@@ -57,11 +57,10 @@ static int __submore __P((FILE *));
* are all at the end (stack-style).
*/
static int
-__submore(fp)
- register FILE *fp;
+__submore(FILE *fp)
{
- register int i;
- register unsigned char *p;
+ int i;
+ unsigned char *p;
if (fp->_ub._base == fp->_ubuf) {
/*
@@ -90,9 +89,7 @@ __submore(fp)
}
int
-ungetc(c, fp)
- int c;
- register FILE *fp;
+ungetc(int c, FILE *fp)
{
if (c == EOF)
return (EOF);
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index 5d588d5de6bd..1e67b1a1a5d9 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -61,9 +61,9 @@ static const char rcsid[] =
#include <varargs.h>
#endif
+#include "libc_private.h"
#include "local.h"
#include "fvwrite.h"
-#include "libc_private.h"
/* Define FLOATING_POINT to get floating point. */
#define FLOATING_POINT
@@ -80,11 +80,9 @@ static void __grow_type_table __P((int, unsigned char **, int *));
* then reset it so that it can be reused.
*/
static int
-__sprint(fp, uio)
- FILE *fp;
- register struct __suio *uio;
+__sprint(FILE *fp, struct __suio *uio)
{
- register int err;
+ int err;
if (uio->uio_resid == 0) {
uio->uio_iovcnt = 0;
@@ -102,10 +100,7 @@ __sprint(fp, uio)
* worries about ungetc buffers and so forth.
*/
static int
-__sbprintf(fp, fmt, ap)
- register FILE *fp;
- const char *fmt;
- va_list ap;
+__sbprintf(FILE *fp, const char *fmt, va_list ap)
{
int ret;
FILE fake;
@@ -145,11 +140,7 @@ __sbprintf(fp, fmt, ap)
* use the given digits.
*/
static char *
-__ultoa(val, endp, base, octzero, xdigs)
- register u_long val;
- char *endp;
- int base, octzero;
- char *xdigs;
+__ultoa(u_long val, char *endp, int base, int octzero, char *xdigs)
{
register char *cp = endp;
register long sval;
@@ -205,14 +196,10 @@ __ultoa(val, endp, base, octzero, xdigs)
/* Identical to __ultoa, but for quads. */
static char *
-__uqtoa(val, endp, base, octzero, xdigs)
- register u_quad_t val;
- char *endp;
- int base, octzero;
- char *xdigs;
+__uqtoa(u_quad_t val, char *endp, int base, int octzero, char *xdigs)
{
- register char *cp = endp;
- register quad_t sval;
+ char *cp = endp;
+ quad_t sval;
/* quick test for small values; __ultoa is typically much faster */
/* (perhaps instead we should run until small, then call __ultoa?) */
@@ -288,17 +275,14 @@ static int exponent __P((char *, int, int));
#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */
#define FPT 0x100 /* Floating point number */
int
-vfprintf(fp, fmt0, ap)
- FILE *fp;
- const char *fmt0;
- va_list ap;
+vfprintf(FILE *fp, const char *fmt0, va_list ap)
{
- register char *fmt; /* format string */
- register int ch; /* character from fmt */
- register int n, n2; /* handy integer (short term usage) */
- register char *cp; /* handy char pointer (short term usage) */
- register struct __siov *iovp;/* for PRINT macro */
- register int flags; /* flags as above */
+ char *fmt; /* format string */
+ int ch; /* character from fmt */
+ int n, n2; /* handy integer (short term usage) */
+ char *cp; /* handy char pointer (short term usage) */
+ struct __siov *iovp; /* for PRINT macro */
+ int flags; /* flags as above */
int ret; /* return value accumulator */
int width; /* width from format (%8d), or 0 */
int prec; /* precision from format (%.3d), or -1 */
@@ -914,16 +898,13 @@ error:
* It will be replaces with a malloc-ed one if it overflows.
*/
static void
-__find_arguments (fmt0, ap, argtable)
- const char *fmt0;
- va_list ap;
- void ***argtable;
+__find_arguments (const char *fmt0, va_list ap, void ***argtable)
{
- register char *fmt; /* format string */
- register int ch; /* character from fmt */
- register int n, n2; /* handy integer (short term usage) */
- register char *cp; /* handy char pointer (short term usage) */
- register int flags; /* flags as above */
+ char *fmt; /* format string */
+ int ch; /* character from fmt */
+ int n, n2; /* handy integer (short term usage) */
+ char *cp; /* handy char pointer (short term usage) */
+ int flags; /* flags as above */
int width; /* width from format (%8d), or 0 */
unsigned char *typetable; /* table of types */
unsigned char stattypetable [STATIC_ARG_TBL_SIZE];
@@ -1186,10 +1167,7 @@ done:
* Increase the size of the type table.
*/
static void
-__grow_type_table (nextarg, typetable, tablesize)
- int nextarg;
- unsigned char **typetable;
- int *tablesize;
+__grow_type_table (int nextarg, unsigned char **typetable, int *tablesize)
{
unsigned char *const oldtable = *typetable;
const int oldsize = *tablesize;
@@ -1218,11 +1196,8 @@ __grow_type_table (nextarg, typetable, tablesize)
extern char *__dtoa __P((double, int, int, int *, int *, char **, char **));
static char *
-cvt(value, ndigits, flags, sign, decpt, ch, length, dtoaresultp)
- double value;
- int ndigits, flags, *decpt, ch, *length;
- char *sign;
- char **dtoaresultp;
+cvt(double value, int ndigits, int flags, char *sign, int *decpt,
+ int ch, int *length, char **dtoaresultp)
{
int mode, dsgn;
char *digits, *bp, *rve;
@@ -1264,11 +1239,9 @@ cvt(value, ndigits, flags, sign, decpt, ch, length, dtoaresultp)
}
static int
-exponent(p0, exp, fmtch)
- char *p0;
- int exp, fmtch;
+exponent(char *p0, int exp, int fmtch)
{
- register char *p, *t;
+ char *p, *t;
char expbuf[MAXEXP];
p = p0;
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 6a832162fa20..e6251852d08b 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -103,18 +103,15 @@ static u_char *__sccl(char *, u_char *);
* vfscanf
*/
int
-__svfscanf(fp, fmt0, ap)
- register FILE *fp;
- char const *fmt0;
- va_list ap;
+__svfscanf(FILE *fp, char const *fmt0, va_list ap)
{
- register u_char *fmt = (u_char *)fmt0;
- register int c; /* character from format, or conversion */
- register size_t width; /* field width, or 0 */
- register char *p; /* points into all kinds of strings */
- register int n; /* handy integer */
- register int flags; /* flags as defined above */
- register char *p0; /* saves original value of p when necessary */
+ u_char *fmt = (u_char *)fmt0;
+ int c; /* character from format, or conversion */
+ size_t width; /* field width, or 0 */
+ char *p; /* points into all kinds of strings */
+ int n; /* handy integer */
+ int flags; /* flags as defined above */
+ char *p0; /* saves original value of p when necessary */
int nassigned; /* number of fields assigned */
int nconversions; /* number of conversions */
int nread; /* number of characters consumed from fp */