Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdio - ansify, knf.



details:   https://anonhg.NetBSD.org/src/rev/d57d6a6a2b3a
branches:  trunk
changeset: 778086:d57d6a6a2b3a
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 15 18:22:30 2012 +0000

description:
- ansify, knf.
- no functional changes

diffstat:

 lib/libc/stdio/asprintf.c     |   8 ++--
 lib/libc/stdio/clrerr.c       |   7 ++--
 lib/libc/stdio/fclose.c       |  11 +++----
 lib/libc/stdio/fdopen.c       |  22 +++++++--------
 lib/libc/stdio/feof.c         |   7 ++--
 lib/libc/stdio/ferror.c       |   7 ++--
 lib/libc/stdio/fflush.c       |  18 +++++-------
 lib/libc/stdio/fgetc.c        |   7 ++--
 lib/libc/stdio/fgets.c        |  13 +++-----
 lib/libc/stdio/fgetwc.c       |   6 ++--
 lib/libc/stdio/fgetwln.c      |  14 +++++-----
 lib/libc/stdio/fgetws.c       |  13 +++-----
 lib/libc/stdio/fileno.c       |   9 ++---
 lib/libc/stdio/findfp.c       |  28 +++++++++-----------
 lib/libc/stdio/flags.c        |   8 ++--
 lib/libc/stdio/flockfile.c    |   6 ++--
 lib/libc/stdio/fopen.c        |  16 +++++------
 lib/libc/stdio/fprintf.c      |   6 ++--
 lib/libc/stdio/fpurge.c       |  11 +++----
 lib/libc/stdio/fputc.c        |   8 ++---
 lib/libc/stdio/fputwc.c       |   6 ++--
 lib/libc/stdio/fputws.c       |  12 +++-----
 lib/libc/stdio/fread.c        |  15 ++++------
 lib/libc/stdio/freopen.c      |  18 +++++-------
 lib/libc/stdio/fscanf.c       |   6 ++--
 lib/libc/stdio/fseeko.c       |  18 ++++++------
 lib/libc/stdio/ftell.c        |  11 +++----
 lib/libc/stdio/ftello.c       |  13 ++++-----
 lib/libc/stdio/funopen.c      |  21 +++++++--------
 lib/libc/stdio/fvwrite.c      |  18 +++++-------
 lib/libc/stdio/fwalk.c        |   9 ++---
 lib/libc/stdio/fwprintf.c     |   6 ++--
 lib/libc/stdio/fwrite.c       |  13 +++-----
 lib/libc/stdio/fwscanf.c      |   6 ++--
 lib/libc/stdio/getc.c         |  12 +++-----
 lib/libc/stdio/getchar.c      |  10 +++---
 lib/libc/stdio/gets.c         |  11 +++----
 lib/libc/stdio/gettemp.c      |  25 ++++++++----------
 lib/libc/stdio/getw.c         |   9 ++---
 lib/libc/stdio/getwchar.c     |   6 ++--
 lib/libc/stdio/makebuf.c      |  20 +++++--------
 lib/libc/stdio/mkdtemp.c      |   9 ++---
 lib/libc/stdio/mkstemp.c      |   9 ++---
 lib/libc/stdio/mktemp.c       |  14 ++++-----
 lib/libc/stdio/printf.c       |   6 ++--
 lib/libc/stdio/putc.c         |  14 +++------
 lib/libc/stdio/putchar.c      |  12 +++-----
 lib/libc/stdio/puts.c         |   9 ++---
 lib/libc/stdio/putw.c         |   8 ++---
 lib/libc/stdio/refill.c       |  28 ++++++++-----------
 lib/libc/stdio/remove.c       |  13 ++++-----
 lib/libc/stdio/rewind.c       |   7 ++--
 lib/libc/stdio/rget.c         |  11 +++----
 lib/libc/stdio/scanf.c        |   6 ++--
 lib/libc/stdio/setbuf.c       |  10 ++----
 lib/libc/stdio/setbuffer.c    |  14 +++------
 lib/libc/stdio/setvbuf.c      |  16 ++++-------
 lib/libc/stdio/snprintf.c     |   8 ++--
 lib/libc/stdio/sprintf.c      |   6 ++--
 lib/libc/stdio/sscanf.c       |  15 +++-------
 lib/libc/stdio/stdio.c        |  21 ++++-----------
 lib/libc/stdio/swprintf.c     |   6 ++--
 lib/libc/stdio/swscanf.c      |   6 ++--
 lib/libc/stdio/tempnam.c      |   6 ++--
 lib/libc/stdio/tmpfile.c      |  12 ++++----
 lib/libc/stdio/tmpnam.c       |   9 ++---
 lib/libc/stdio/ungetc.c       |  36 +++++++++++--------------
 lib/libc/stdio/vasprintf.c    |   8 ++--
 lib/libc/stdio/vfscanf.c      |  30 ++++++++++-----------
 lib/libc/stdio/vfwprintf.c    |  58 +++++++++++++++++++++---------------------
 lib/libc/stdio/vfwscanf.c     |  14 +++++-----
 lib/libc/stdio/vprintf.c      |   6 ++--
 lib/libc/stdio/vscanf.c       |   6 ++--
 lib/libc/stdio/vsnprintf.c    |   8 ++--
 lib/libc/stdio/vsnprintf_ss.c |   8 ++--
 lib/libc/stdio/vsprintf.c     |   6 ++--
 lib/libc/stdio/vsscanf.c      |  15 +++-------
 lib/libc/stdio/vswprintf.c    |  16 +++++-----
 lib/libc/stdio/vswscanf.c     |  14 ++++-----
 lib/libc/stdio/vwprintf.c     |   6 ++--
 lib/libc/stdio/vwscanf.c      |   6 ++--
 lib/libc/stdio/wbuf.c         |  16 +++++------
 lib/libc/stdio/wprintf.c      |   6 ++--
 lib/libc/stdio/wscanf.c       |   6 ++--
 lib/libc/stdio/wsetup.c       |  11 +++----
 85 files changed, 465 insertions(+), 576 deletions(-)

diffs (truncated from 3842 to 300 lines):

diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/asprintf.c
--- a/lib/libc/stdio/asprintf.c Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/asprintf.c Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asprintf.c,v 1.18 2009/10/25 20:44:13 christos Exp $   */
+/*     $NetBSD: asprintf.c,v 1.19 2012/03/15 18:22:30 christos Exp $   */
 
 /*
  * Copyright (c) 1997 Todd C. Miller <Todd.Miller%courtesan.com@localhost>
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: asprintf.c,v 1.18 2009/10/25 20:44:13 christos Exp $");
+__RCSID("$NetBSD: asprintf.c,v 1.19 2012/03/15 18:22:30 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -74,12 +74,12 @@
        if (_base == NULL)
                goto err;
        *str = (char *)_base;
-       return (ret);
+       return ret;
 
 err:
        if (f._bf._base)
                free(f._bf._base);
        *str = NULL;
        errno = ENOMEM;
-       return (-1);
+       return -1;
 }
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/clrerr.c
--- a/lib/libc/stdio/clrerr.c   Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/clrerr.c   Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clrerr.c,v 1.10 2003/08/07 16:43:21 agc Exp $  */
+/*     $NetBSD: clrerr.c,v 1.11 2012/03/15 18:22:30 christos Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)clrerr.c   8.1 (Berkeley) 6/4/93";
 #endif
-__RCSID("$NetBSD: clrerr.c,v 1.10 2003/08/07 16:43:21 agc Exp $");
+__RCSID("$NetBSD: clrerr.c,v 1.11 2012/03/15 18:22:30 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -48,8 +48,7 @@
 #undef clearerr
 
 void
-clearerr(fp)
-       FILE *fp;
+clearerr(FILE *fp)
 {
        _DIAGASSERT(fp != NULL);
 
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/fclose.c
--- a/lib/libc/stdio/fclose.c   Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/fclose.c   Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fclose.c,v 1.17 2010/01/11 20:39:29 joerg Exp $        */
+/*     $NetBSD: fclose.c,v 1.18 2012/03/15 18:22:30 christos Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fclose.c   8.1 (Berkeley) 6/4/93";
 #endif
-__RCSID("$NetBSD: fclose.c,v 1.17 2010/01/11 20:39:29 joerg Exp $");
+__RCSID("$NetBSD: fclose.c,v 1.18 2012/03/15 18:22:30 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -49,8 +49,7 @@
 #include "local.h"
 
 int
-fclose(fp)
-       FILE *fp;
+fclose(FILE *fp)
 {
        int r;
 
@@ -58,7 +57,7 @@
 
        if (fp->_flags == 0) {  /* not open! */
                errno = EBADF;
-               return (EOF);
+               return EOF;
        }
        FLOCKFILE(fp);
        WCIO_FREE(fp);
@@ -74,5 +73,5 @@
        fp->_file = -1;
        fp->_flags = 0;         /* Release this FILE for reuse. */
        fp->_r = fp->_w = 0;    /* Mess up if reaccessed. */
-       return (r);
+       return r;
 }
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/fdopen.c
--- a/lib/libc/stdio/fdopen.c   Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/fdopen.c   Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fdopen.c,v 1.15 2008/03/13 15:40:00 christos Exp $     */
+/*     $NetBSD: fdopen.c,v 1.16 2012/03/15 18:22:30 christos Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fdopen.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fdopen.c,v 1.15 2008/03/13 15:40:00 christos Exp $");
+__RCSID("$NetBSD: fdopen.c,v 1.16 2012/03/15 18:22:30 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -59,9 +59,7 @@
 #endif
 
 FILE *
-fdopen(fd, mode)
-       int fd;
-       const char *mode;
+fdopen(int fd, const char *mode)
 {
        FILE *fp;
        int flags, oflags, fdflags, tmp;
@@ -81,30 +79,30 @@
        }
 
        if ((flags = __sflags(mode, &oflags)) == 0)
-               return (NULL);
+               return NULL;
 
        /* Make sure the mode the user wants is a subset of the actual mode. */
        if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0)
-               return (NULL);
+               return NULL;
        tmp = fdflags & O_ACCMODE;
        if (tmp != O_RDWR && (tmp != (oflags & O_ACCMODE))) {
                errno = EINVAL;
-               return (NULL);
+               return NULL;
        }
 
        if (oflags & O_NONBLOCK) {
                struct stat st;
                if (fstat(fd, &st) == -1) {
-                       return (NULL);
+                       return NULL;
                }
                if (!S_ISREG(st.st_mode)) {
                        errno = EFTYPE;
-                       return (NULL);
+                       return NULL;
                }
        }
 
        if ((fp = __sfp()) == NULL)
-               return (NULL);
+               return NULL;
        fp->_flags = flags;
        /*
         * If opened for appending, but underlying descriptor does not have
@@ -119,5 +117,5 @@
        fp->_write = __swrite;
        fp->_seek = __sseek;
        fp->_close = __sclose;
-       return (fp);
+       return fp;
 }
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/feof.c
--- a/lib/libc/stdio/feof.c     Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/feof.c     Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: feof.c,v 1.11 2003/08/07 16:43:22 agc Exp $    */
+/*     $NetBSD: feof.c,v 1.12 2012/03/15 18:22:30 christos Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)feof.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: feof.c,v 1.11 2003/08/07 16:43:22 agc Exp $");
+__RCSID("$NetBSD: feof.c,v 1.12 2012/03/15 18:22:30 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -52,8 +52,7 @@
 #undef feof
 
 int
-feof(fp)
-       FILE *fp;
+feof(FILE *fp)
 {
        int r;
 
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/ferror.c
--- a/lib/libc/stdio/ferror.c   Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/ferror.c   Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ferror.c,v 1.11 2003/08/07 16:43:22 agc Exp $  */
+/*     $NetBSD: ferror.c,v 1.12 2012/03/15 18:22:30 christos Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)ferror.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: ferror.c,v 1.11 2003/08/07 16:43:22 agc Exp $");
+__RCSID("$NetBSD: ferror.c,v 1.12 2012/03/15 18:22:30 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -52,8 +52,7 @@
 #undef ferror
 
 int
-ferror(fp)
-       FILE *fp;
+ferror(FILE *fp)
 {
        int r;
 
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/fflush.c
--- a/lib/libc/stdio/fflush.c   Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/fflush.c   Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fflush.c,v 1.16 2012/03/13 21:13:46 christos Exp $     */
+/*     $NetBSD: fflush.c,v 1.17 2012/03/15 18:22:30 christos Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fflush.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fflush.c,v 1.16 2012/03/13 21:13:46 christos Exp $");
+__RCSID("$NetBSD: fflush.c,v 1.17 2012/03/15 18:22:30 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -54,8 +54,7 @@
 
 /* Flush a single file, or (if fp is NULL) all files.  */
 int
-fflush(fp)
-       FILE *fp;
+fflush(FILE *fp)
 {
        int r;
 
@@ -78,8 +77,7 @@
 }
 
 int
-__sflush(fp)
-       FILE *fp;
+__sflush(FILE *fp)
 {
        unsigned char *p;
        int n, t;
@@ -88,10 +86,10 @@
 
        t = fp->_flags;
        if ((t & __SWR) == 0)
-               return (0);
+               return 0;
 
        if ((p = fp->_bf._base) == NULL)
-               return (0);
+               return 0;
 
        ptrdiff_t tp = fp->_p - p;
        _DIAGASSERT(__type_fit(int, tp));
@@ -108,8 +106,8 @@
                t = (*fp->_write)(fp->_cookie, (char *)p, n);
                if (t <= 0) {
                        fp->_flags |= __SERR;
-                       return (EOF);
+                       return EOF;
                }
        }
-       return (0);
+       return 0;
 }
diff -r c5f5ac3873ce -r d57d6a6a2b3a lib/libc/stdio/fgetc.c
--- a/lib/libc/stdio/fgetc.c    Thu Mar 15 16:47:38 2012 +0000
+++ b/lib/libc/stdio/fgetc.c    Thu Mar 15 18:22:30 2012 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index