Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/stdio Lint is differentially far too picky...



details:   https://anonhg.NetBSD.org/src/rev/aeb7dae77871
branches:  trunk
changeset: 748491:aeb7dae77871
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun Oct 25 17:09:34 2009 +0000

description:
Lint is differentially far too picky...
Remove some warnings that only appear on i386 (not on amd64) and that
for some reason best known to others are deemed fatal for i386.
Making this code 'pass lint' does absolutely nothing for its readability (etc).

diffstat:

 lib/libc/stdio/asprintf.c |   6 +++---
 lib/libc/stdio/fgets.c    |  10 +++++-----
 lib/libc/stdio/fgetwc.c   |   6 +++---
 lib/libc/stdio/fread.c    |   6 +++---
 lib/libc/stdio/fvwrite.c  |  10 +++++-----
 lib/libc/stdio/getdelim.c |   6 +++---
 6 files changed, 22 insertions(+), 22 deletions(-)

diffs (194 lines):

diff -r f7f78c6c3f06 -r aeb7dae77871 lib/libc/stdio/asprintf.c
--- a/lib/libc/stdio/asprintf.c Sun Oct 25 16:20:16 2009 +0000
+++ b/lib/libc/stdio/asprintf.c Sun Oct 25 17:09:34 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asprintf.c,v 1.16 2009/10/24 15:20:15 dsl Exp $        */
+/*     $NetBSD: asprintf.c,v 1.17 2009/10/25 17:09:34 dsl 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.16 2009/10/24 15:20:15 dsl Exp $");
+__RCSID("$NetBSD: asprintf.c,v 1.17 2009/10/25 17:09:34 dsl Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -70,7 +70,7 @@
        if (ret < 0)
                goto err;
        *f._p = '\0';
-       _base = realloc(f._bf._base, ret + 1);
+       _base = realloc(f._bf._base, ret + 1u);
        if (_base == NULL)
                goto err;
        *str = (char *)_base;
diff -r f7f78c6c3f06 -r aeb7dae77871 lib/libc/stdio/fgets.c
--- a/lib/libc/stdio/fgets.c    Sun Oct 25 16:20:16 2009 +0000
+++ b/lib/libc/stdio/fgets.c    Sun Oct 25 17:09:34 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fgets.c,v 1.25 2009/10/24 15:20:15 dsl Exp $   */
+/*     $NetBSD: fgets.c,v 1.26 2009/10/25 17:09:34 dsl Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fgets.c    8.2 (Berkeley) 12/22/93";
 #else
-__RCSID("$NetBSD: fgets.c,v 1.25 2009/10/24 15:20:15 dsl Exp $");
+__RCSID("$NetBSD: fgets.c,v 1.26 2009/10/25 17:09:34 dsl Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -112,19 +112,19 @@
                        }
                        len = n;
                }
-               t = memchr(p, '\n', len);
+               t = memchr(p, '\n', len + 0u);
                if (t != NULL) {
                        len = (int)(++t - p);
                        fp->_r -= len;
                        fp->_p = t;
-                       (void)memcpy(s, p, len);
+                       (void)memcpy(s, p, len + 0u);
                        s[len] = 0;
                        FUNLOCKFILE(fp);
                        return (buf);
                }
                fp->_r -= len;
                fp->_p += len;
-               (void)memcpy(s, p, len);
+               (void)memcpy(s, p, len + 0u);
                s += len;
                n -= len;
        } while (n != 0);
diff -r f7f78c6c3f06 -r aeb7dae77871 lib/libc/stdio/fgetwc.c
--- a/lib/libc/stdio/fgetwc.c   Sun Oct 25 16:20:16 2009 +0000
+++ b/lib/libc/stdio/fgetwc.c   Sun Oct 25 17:09:34 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fgetwc.c,v 1.9 2009/10/24 15:20:15 dsl Exp $ */
+/* $NetBSD: fgetwc.c,v 1.10 2009/10/25 17:09:34 dsl Exp $ */
 
 /*-
  * Copyright (c)2001 Citrus Project,
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fgetwc.c,v 1.9 2009/10/24 15:20:15 dsl Exp $");
+__RCSID("$NetBSD: fgetwc.c,v 1.10 2009/10/25 17:09:34 dsl Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -63,7 +63,7 @@
                        return WEOF;
        }
        nr = mbrtowc(&wc, (const char *)fp->_p,
-           fp->_r, &wcio->wcio_mbstate_in);
+           fp->_r + 0u, &wcio->wcio_mbstate_in);
        if (nr == (size_t)-1) {
                fp->_flags |= __SERR;
                return WEOF;
diff -r f7f78c6c3f06 -r aeb7dae77871 lib/libc/stdio/fread.c
--- a/lib/libc/stdio/fread.c    Sun Oct 25 16:20:16 2009 +0000
+++ b/lib/libc/stdio/fread.c    Sun Oct 25 17:09:34 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fread.c,v 1.18 2009/10/24 15:20:15 dsl Exp $   */
+/*     $NetBSD: fread.c,v 1.19 2009/10/25 17:09:34 dsl Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fread.c    8.2 (Berkeley) 12/11/93";
 #else
-__RCSID("$NetBSD: fread.c,v 1.18 2009/10/24 15:20:15 dsl Exp $");
+__RCSID("$NetBSD: fread.c,v 1.19 2009/10/25 17:09:34 dsl Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -76,7 +76,7 @@
        total = resid;
        p = buf;
        while (resid > (size_t)(r = fp->_r)) {
-               (void)memcpy(p, fp->_p, r);
+               (void)memcpy(p, fp->_p, r + 0u);
                fp->_p += r;
                /* fp->_r = 0 ... done in __srefill */
                p += r;
diff -r f7f78c6c3f06 -r aeb7dae77871 lib/libc/stdio/fvwrite.c
--- a/lib/libc/stdio/fvwrite.c  Sun Oct 25 16:20:16 2009 +0000
+++ b/lib/libc/stdio/fvwrite.c  Sun Oct 25 17:09:34 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fvwrite.c,v 1.19 2009/10/24 15:20:15 dsl Exp $ */
+/*     $NetBSD: fvwrite.c,v 1.20 2009/10/25 17:09:34 dsl Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)fvwrite.c  8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: fvwrite.c,v 1.19 2009/10/24 15:20:15 dsl Exp $");
+__RCSID("$NetBSD: fvwrite.c,v 1.20 2009/10/25 17:09:34 dsl Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -84,7 +84,7 @@
        }
 
 #define        MIN(a, b) ((a) < (b) ? (a) : (b))
-#define        COPY(n)   (void)memcpy(fp->_p, p, (n))
+#define        COPY(n)   (void)memcpy(fp->_p, p, (n) + 0u)
 
        iov = uio->uio_iov;
        p = iov->iov_base;
@@ -135,7 +135,7 @@
                                do {
                                        _size = (_size << 1) + 1;
                                } while (_size < blen + len);
-                               _base = realloc(fp->_bf._base, _size + 1);
+                               _base = realloc(fp->_bf._base, _size + 1u);
                                if (_base == NULL)
                                        goto err;
                                fp->_w += _size - fp->_bf._size;
@@ -186,7 +186,7 @@
                do {
                        GETIOV(nlknown = 0);
                        if (!nlknown) {
-                               nl = memchr(p, '\n', len);
+                               nl = memchr(p, '\n', len + 0u);
                                nldist = nl ? nl + 1 - p : len + 1;
                                nlknown = 1;
                        }
diff -r f7f78c6c3f06 -r aeb7dae77871 lib/libc/stdio/getdelim.c
--- a/lib/libc/stdio/getdelim.c Sun Oct 25 16:20:16 2009 +0000
+++ b/lib/libc/stdio/getdelim.c Sun Oct 25 17:09:34 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getdelim.c,v 1.5 2009/10/24 15:20:15 dsl Exp $ */
+/* $NetBSD: getdelim.c,v 1.6 2009/10/25 17:09:34 dsl Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: getdelim.c,v 1.5 2009/10/24 15:20:15 dsl Exp $");
+__RCSID("$NetBSD: getdelim.c,v 1.6 2009/10/25 17:09:34 dsl Exp $");
 
 #include "namespace.h"
 
@@ -83,7 +83,7 @@
                }
 
                /* Scan through looking for the separator */
-               p = memchr(fp->_p, sep, fp->_r);
+               p = memchr(fp->_p, sep, fp->_r + 0u);
                if (p == NULL)
                        len = fp->_r;
                else



Home | Main Index | Thread Index | Old Index