From d25ccb197d0cad4b4a1b8816171ccde29b7274b7 Mon Sep 17 00:00:00 2001 From: Chris Torek Date: Tue, 5 Feb 1991 08:27:11 -0800 Subject: [PATCH] repair arguments (add const) SCCS-vsn: lib/libc/stdio/fdopen.c 5.5 SCCS-vsn: lib/libc/stdio/fopen.c 5.4 SCCS-vsn: lib/libc/stdio/fputs.c 5.5 SCCS-vsn: lib/libc/stdio/freopen.c 5.5 SCCS-vsn: lib/libc/stdio/fseek.c 5.6 SCCS-vsn: lib/libc/stdio/ftell.c 5.4 SCCS-vsn: lib/libc/stdio/fwrite.c 5.4 SCCS-vsn: lib/libc/stdio/remove.c 5.2 SCCS-vsn: lib/libc/stdio/vsnprintf.c 5.2 SCCS-vsn: lib/libc/stdio/vsprintf.c 5.5 SCCS-vsn: lib/libc/stdio/fsetpos.c 5.2 SCCS-vsn: lib/libc/stdio/funopen.c 5.2 --- usr/src/lib/libc/stdio/fdopen.c | 4 ++-- usr/src/lib/libc/stdio/fopen.c | 6 +++--- usr/src/lib/libc/stdio/fputs.c | 6 +++--- usr/src/lib/libc/stdio/freopen.c | 4 ++-- usr/src/lib/libc/stdio/fseek.c | 5 +++-- usr/src/lib/libc/stdio/fsetpos.c | 4 ++-- usr/src/lib/libc/stdio/ftell.c | 4 ++-- usr/src/lib/libc/stdio/funopen.c | 8 ++++---- usr/src/lib/libc/stdio/fwrite.c | 6 +++--- usr/src/lib/libc/stdio/remove.c | 4 ++-- usr/src/lib/libc/stdio/vsnprintf.c | 4 ++-- usr/src/lib/libc/stdio/vsprintf.c | 4 ++-- 12 files changed, 30 insertions(+), 29 deletions(-) diff --git a/usr/src/lib/libc/stdio/fdopen.c b/usr/src/lib/libc/stdio/fdopen.c index d50491105f..ea40f5a857 100644 --- a/usr/src/lib/libc/stdio/fdopen.c +++ b/usr/src/lib/libc/stdio/fdopen.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fdopen.c 5.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)fdopen.c 5.5 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -21,7 +21,7 @@ static char sccsid[] = "@(#)fdopen.c 5.4 (Berkeley) %G%"; FILE * fdopen(fd, mode) int fd; - char *mode; + const char *mode; { register FILE *fp; static int nofile; diff --git a/usr/src/lib/libc/stdio/fopen.c b/usr/src/lib/libc/stdio/fopen.c index 1b78443f8a..ca2edd5799 100644 --- a/usr/src/lib/libc/stdio/fopen.c +++ b/usr/src/lib/libc/stdio/fopen.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fopen.c 5.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)fopen.c 5.4 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -20,8 +20,8 @@ static char sccsid[] = "@(#)fopen.c 5.3 (Berkeley) %G%"; FILE * fopen(file, mode) - char *file; - char *mode; + const char *file; + const char *mode; { register FILE *fp; register int f; diff --git a/usr/src/lib/libc/stdio/fputs.c b/usr/src/lib/libc/stdio/fputs.c index 34b03414b3..e81a5620e8 100644 --- a/usr/src/lib/libc/stdio/fputs.c +++ b/usr/src/lib/libc/stdio/fputs.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fputs.c 5.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)fputs.c 5.5 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -21,13 +21,13 @@ static char sccsid[] = "@(#)fputs.c 5.4 (Berkeley) %G%"; * Write the given string to the given file. */ fputs(s, fp) - char *s; + const char *s; FILE *fp; { struct __suio uio; struct __siov iov; - iov.iov_base = s; + iov.iov_base = (void *)s; iov.iov_len = uio.uio_resid = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; diff --git a/usr/src/lib/libc/stdio/freopen.c b/usr/src/lib/libc/stdio/freopen.c index 224a253079..bcec472d29 100644 --- a/usr/src/lib/libc/stdio/freopen.c +++ b/usr/src/lib/libc/stdio/freopen.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)freopen.c 5.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)freopen.c 5.5 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -27,7 +27,7 @@ static char sccsid[] = "@(#)freopen.c 5.4 (Berkeley) %G%"; */ FILE * freopen(file, mode, fp) - char *file, *mode; + const char *file, *mode; register FILE *fp; { register int f; diff --git a/usr/src/lib/libc/stdio/fseek.c b/usr/src/lib/libc/stdio/fseek.c index 38b502fcde..a84b173632 100644 --- a/usr/src/lib/libc/stdio/fseek.c +++ b/usr/src/lib/libc/stdio/fseek.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fseek.c 5.5 (Berkeley) %G%"; +static char sccsid[] = "@(#)fseek.c 5.6 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -31,7 +31,7 @@ fseek(fp, offset, whence) int whence; { #if __STDC__ - register fpos_t (*seekfn)(char *, fpos_t, int); + register fpos_t (*seekfn)(void *, fpos_t, int); #else register fpos_t (*seekfn)(); #endif @@ -85,6 +85,7 @@ fseek(fp, offset, whence) case SEEK_SET: case SEEK_END: + curoff = 0; /* XXX just to keep gcc quiet */ havepos = 0; break; diff --git a/usr/src/lib/libc/stdio/fsetpos.c b/usr/src/lib/libc/stdio/fsetpos.c index 52d481b92d..2cb977657b 100644 --- a/usr/src/lib/libc/stdio/fsetpos.c +++ b/usr/src/lib/libc/stdio/fsetpos.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fsetpos.c 5.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)fsetpos.c 5.2 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -19,7 +19,7 @@ static char sccsid[] = "@(#)fsetpos.c 5.1 (Berkeley) %G%"; */ fsetpos(iop, pos) FILE *iop; - fpos_t *pos; + const fpos_t *pos; { return (fseek(iop, (long)*pos, SEEK_SET)); } diff --git a/usr/src/lib/libc/stdio/ftell.c b/usr/src/lib/libc/stdio/ftell.c index ed806bf199..8ab97eceae 100644 --- a/usr/src/lib/libc/stdio/ftell.c +++ b/usr/src/lib/libc/stdio/ftell.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)ftell.c 5.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)ftell.c 5.4 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -21,7 +21,7 @@ static char sccsid[] = "@(#)ftell.c 5.3 (Berkeley) %G%"; */ long ftell(fp) - register FILE *fp; + register const FILE *fp; { register fpos_t pos; diff --git a/usr/src/lib/libc/stdio/funopen.c b/usr/src/lib/libc/stdio/funopen.c index 13af26c384..c84b568b07 100644 --- a/usr/src/lib/libc/stdio/funopen.c +++ b/usr/src/lib/libc/stdio/funopen.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)funopen.c 5.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)funopen.c 5.2 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -18,10 +18,10 @@ static char sccsid[] = "@(#)funopen.c 5.1 (Berkeley) %G%"; FILE * funopen(cookie, readfn, writefn, seekfn, closefn) - char *cookie; + const void *cookie; int (*readfn)(), (*writefn)(); #if __STDC__ - fpos_t (*seekfn)(char *cookie, fpos_t off, int whence); + fpos_t (*seekfn)(void *cookie, fpos_t off, int whence); #else fpos_t (*seekfn)(); #endif @@ -46,7 +46,7 @@ funopen(cookie, readfn, writefn, seekfn, closefn) return (NULL); fp->_flags = flags; fp->_file = -1; - fp->_cookie = cookie; + fp->_cookie = (void *)cookie; fp->_read = readfn; fp->_write = writefn; fp->_seek = seekfn; diff --git a/usr/src/lib/libc/stdio/fwrite.c b/usr/src/lib/libc/stdio/fwrite.c index d601cec372..6934b31c72 100644 --- a/usr/src/lib/libc/stdio/fwrite.c +++ b/usr/src/lib/libc/stdio/fwrite.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)fwrite.c 5.3 (Berkeley) %G%"; +static char sccsid[] = "@(#)fwrite.c 5.4 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -22,7 +22,7 @@ static char sccsid[] = "@(#)fwrite.c 5.3 (Berkeley) %G%"; * Return the number of whole objects written. */ fwrite(buf, size, count, fp) - void *buf; + const void *buf; size_t size, count; FILE *fp; { @@ -30,7 +30,7 @@ fwrite(buf, size, count, fp) struct __suio uio; struct __siov iov; - iov.iov_base = buf; + iov.iov_base = (void *)buf; uio.uio_resid = iov.iov_len = n = count * size; uio.uio_iov = &iov; uio.uio_iovcnt = 1; diff --git a/usr/src/lib/libc/stdio/remove.c b/usr/src/lib/libc/stdio/remove.c index 81f929bc7d..9d7184adc0 100644 --- a/usr/src/lib/libc/stdio/remove.c +++ b/usr/src/lib/libc/stdio/remove.c @@ -9,13 +9,13 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)remove.c 5.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)remove.c 5.2 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include remove(file) - char *file; + const char *file; { return (unlink(file)); } diff --git a/usr/src/lib/libc/stdio/vsnprintf.c b/usr/src/lib/libc/stdio/vsnprintf.c index 8492da49b2..348b960cc0 100644 --- a/usr/src/lib/libc/stdio/vsnprintf.c +++ b/usr/src/lib/libc/stdio/vsnprintf.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)vsnprintf.c 5.1 (Berkeley) %G%"; +static char sccsid[] = "@(#)vsnprintf.c 5.2 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -17,7 +17,7 @@ static char sccsid[] = "@(#)vsnprintf.c 5.1 (Berkeley) %G%"; vsnprintf(str, n, fmt, ap) char *str; size_t n; - char *fmt; + const char *fmt; _VA_LIST_ ap; { int ret; diff --git a/usr/src/lib/libc/stdio/vsprintf.c b/usr/src/lib/libc/stdio/vsprintf.c index c2c23f3ba9..f88bc44705 100644 --- a/usr/src/lib/libc/stdio/vsprintf.c +++ b/usr/src/lib/libc/stdio/vsprintf.c @@ -9,7 +9,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)vsprintf.c 5.4 (Berkeley) %G%"; +static char sccsid[] = "@(#)vsprintf.c 5.5 (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ #include @@ -17,7 +17,7 @@ static char sccsid[] = "@(#)vsprintf.c 5.4 (Berkeley) %G%"; vsprintf(str, fmt, ap) char *str; - char *fmt; + const char *fmt; _VA_LIST_ ap; { int ret; -- 2.20.1