repair arguments (add const)
authorChris Torek <torek@ucbvax.Berkeley.EDU>
Tue, 5 Feb 1991 16:27:11 +0000 (08:27 -0800)
committerChris Torek <torek@ucbvax.Berkeley.EDU>
Tue, 5 Feb 1991 16:27:11 +0000 (08:27 -0800)
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

12 files changed:
usr/src/lib/libc/stdio/fdopen.c
usr/src/lib/libc/stdio/fopen.c
usr/src/lib/libc/stdio/fputs.c
usr/src/lib/libc/stdio/freopen.c
usr/src/lib/libc/stdio/fseek.c
usr/src/lib/libc/stdio/fsetpos.c
usr/src/lib/libc/stdio/ftell.c
usr/src/lib/libc/stdio/funopen.c
usr/src/lib/libc/stdio/fwrite.c
usr/src/lib/libc/stdio/remove.c
usr/src/lib/libc/stdio/vsnprintf.c
usr/src/lib/libc/stdio/vsprintf.c

index d504911..ea40f5a 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -21,7 +21,7 @@ static char sccsid[] = "@(#)fdopen.c  5.4 (Berkeley) %G%";
 FILE *
 fdopen(fd, mode)
        int fd;
 FILE *
 fdopen(fd, mode)
        int fd;
-       char *mode;
+       const char *mode;
 {
        register FILE *fp;
        static int nofile;
 {
        register FILE *fp;
        static int nofile;
index 1b78443..ca2edd5 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -20,8 +20,8 @@ static char sccsid[] = "@(#)fopen.c   5.3 (Berkeley) %G%";
 
 FILE *
 fopen(file, mode)
 
 FILE *
 fopen(file, mode)
-       char *file;
-       char *mode;
+       const char *file;
+       const char *mode;
 {
        register FILE *fp;
        register int f;
 {
        register FILE *fp;
        register int f;
index 34b0341..e81a562 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <sys/cdefs.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/cdefs.h>
@@ -21,13 +21,13 @@ static char sccsid[] = "@(#)fputs.c 5.4 (Berkeley) %G%";
  * Write the given string to the given file.
  */
 fputs(s, fp)
  * Write the given string to the given file.
  */
 fputs(s, fp)
-       char *s;
+       const char *s;
        FILE *fp;
 {
        struct __suio uio;
        struct __siov iov;
 
        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;
        iov.iov_len = uio.uio_resid = strlen(s);
        uio.uio_iov = &iov;
        uio.uio_iovcnt = 1;
index 224a253..bcec472 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -27,7 +27,7 @@ static char sccsid[] = "@(#)freopen.c 5.4 (Berkeley) %G%";
  */
 FILE *
 freopen(file, mode, fp)
  */
 FILE *
 freopen(file, mode, fp)
-       char *file, *mode;
+       const char *file, *mode;
        register FILE *fp;
 {
        register int f;
        register FILE *fp;
 {
        register int f;
index 38b502f..a84b173 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -31,7 +31,7 @@ fseek(fp, offset, whence)
        int whence;
 {
 #if __STDC__
        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
 #else
        register fpos_t (*seekfn)();
 #endif
@@ -85,6 +85,7 @@ fseek(fp, offset, whence)
 
        case SEEK_SET:
        case SEEK_END:
 
        case SEEK_SET:
        case SEEK_END:
+               curoff = 0;             /* XXX just to keep gcc quiet */
                havepos = 0;
                break;
 
                havepos = 0;
                break;
 
index 52d481b..2cb9776 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -19,7 +19,7 @@ static char sccsid[] = "@(#)fsetpos.c 5.1 (Berkeley) %G%";
  */
 fsetpos(iop, pos)
        FILE *iop;
  */
 fsetpos(iop, pos)
        FILE *iop;
-       fpos_t *pos;
+       const fpos_t *pos;
 {
        return (fseek(iop, (long)*pos, SEEK_SET));
 }
 {
        return (fseek(iop, (long)*pos, SEEK_SET));
 }
index ed806bf..8ab97ec 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -21,7 +21,7 @@ static char sccsid[] = "@(#)ftell.c   5.3 (Berkeley) %G%";
  */
 long
 ftell(fp)
  */
 long
 ftell(fp)
-       register FILE *fp;
+       register const FILE *fp;
 {
        register fpos_t pos;
 
 {
        register fpos_t pos;
 
index 13af26c..c84b568 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -18,10 +18,10 @@ static char sccsid[] = "@(#)funopen.c       5.1 (Berkeley) %G%";
 
 FILE *
 funopen(cookie, readfn, writefn, seekfn, closefn)
 
 FILE *
 funopen(cookie, readfn, writefn, seekfn, closefn)
-       char *cookie;
+       const void *cookie;
        int (*readfn)(), (*writefn)();
 #if __STDC__
        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
 #else
        fpos_t (*seekfn)();
 #endif
@@ -46,7 +46,7 @@ funopen(cookie, readfn, writefn, seekfn, closefn)
                return (NULL);
        fp->_flags = flags;
        fp->_file = -1;
                return (NULL);
        fp->_flags = flags;
        fp->_file = -1;
-       fp->_cookie = cookie;
+       fp->_cookie = (void *)cookie;
        fp->_read = readfn;
        fp->_write = writefn;
        fp->_seek = seekfn;
        fp->_read = readfn;
        fp->_write = writefn;
        fp->_seek = seekfn;
index d601cec..6934b31 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -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)
  * Return the number of whole objects written.
  */
 fwrite(buf, size, count, fp)
-       void *buf;
+       const void *buf;
        size_t size, count;
        FILE *fp;
 {
        size_t size, count;
        FILE *fp;
 {
@@ -30,7 +30,7 @@ fwrite(buf, size, count, fp)
        struct __suio uio;
        struct __siov iov;
 
        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;
        uio.uio_resid = iov.iov_len = n = count * size;
        uio.uio_iov = &iov;
        uio.uio_iovcnt = 1;
index 81f929b..9d7184a 100644 (file)
@@ -9,13 +9,13 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 
 remove(file)
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 
 remove(file)
-       char *file;
+       const char *file;
 {
        return (unlink(file));
 }
 {
        return (unlink(file));
 }
index 8492da4..348b960 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#)vsnprintf.c       5.1 (Berkeley) %G%";
 vsnprintf(str, n, fmt, ap)
        char *str;
        size_t n;
 vsnprintf(str, n, fmt, ap)
        char *str;
        size_t n;
-       char *fmt;
+       const char *fmt;
        _VA_LIST_ ap;
 {
        int ret;
        _VA_LIST_ ap;
 {
        int ret;
index c2c23f3..f88bc44 100644 (file)
@@ -9,7 +9,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #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 <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#)vsprintf.c        5.4 (Berkeley) %G%";
 
 vsprintf(str, fmt, ap)
        char *str;
 
 vsprintf(str, fmt, ap)
        char *str;
-       char *fmt;
+       const char *fmt;
        _VA_LIST_ ap;
 {
        int ret;
        _VA_LIST_ ap;
 {
        int ret;