Source-Changes-HG archive

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

[src/trunk]: src/lib/libc -Wstrict-overflow



details:   https://anonhg.NetBSD.org/src/rev/333b0336d4f3
branches:  trunk
changeset: 782098:333b0336d4f3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Oct 15 22:22:01 2012 +0000

description:
-Wstrict-overflow

diffstat:

 lib/libc/citrus/citrus_module.c      |  20 ++++++++++----------
 lib/libc/compat/net/compat_ns_addr.c |   7 ++++---
 2 files changed, 14 insertions(+), 13 deletions(-)

diffs (100 lines):

diff -r 71e550e2f22d -r 333b0336d4f3 lib/libc/citrus/citrus_module.c
--- a/lib/libc/citrus/citrus_module.c   Mon Oct 15 18:15:28 2012 +0000
+++ b/lib/libc/citrus/citrus_module.c   Mon Oct 15 22:22:01 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: citrus_module.c,v 1.9 2009/01/11 02:46:24 christos Exp $       */
+/*     $NetBSD: citrus_module.c,v 1.10 2012/10/15 22:22:01 msaitoh Exp $       */
 
 /*-
  * Copyright (c)1999, 2000, 2001, 2002 Citrus Project,
@@ -89,7 +89,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_module.c,v 1.9 2009/01/11 02:46:24 christos Exp $");
+__RCSID("$NetBSD: citrus_module.c,v 1.10 2012/10/15 22:22:01 msaitoh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -111,8 +111,8 @@
 
 #ifdef _I18N_DYNAMIC
 
-static int _getdewey(int [], char *);
-static int _cmpndewey(int [], int, int [], int);
+static unsigned int _getdewey(int [], char *);
+static int _cmpndewey(int [], unsigned int, int [], unsigned int);
 static const char *_findshlib(char *, int *, int *);
 
 static const char *_pathI18nModule = NULL;
@@ -122,10 +122,10 @@
 #undef minor
 #define MAXDEWEY       3       /*ELF*/
 
-static int
+static unsigned int
 _getdewey(int dewey[], char *cp)
 {
-       int     i, n;
+       unsigned int    i, n;
 
        _DIAGASSERT(dewey != NULL);
        _DIAGASSERT(cp != NULL);
@@ -151,9 +151,9 @@
  * Return  0 if equal.
  */
 static int
-_cmpndewey(int d1[], int n1, int d2[], int n2)
+_cmpndewey(int d1[], unsigned int n1, int d2[], unsigned int n2)
 {
-       register int    i;
+       register unsigned int   i;
 
        _DIAGASSERT(d1 != NULL);
        _DIAGASSERT(d2 != NULL);
@@ -182,7 +182,7 @@
 _findshlib(char *name, int *majorp, int *minorp)
 {
        int             dewey[MAXDEWEY];
-       int             ndewey;
+       unsigned int    ndewey;
        int             tmp[MAXDEWEY];
        int             i;
        int             len;
@@ -215,7 +215,7 @@
                        continue;
 
                while ((dp = readdir(dd)) != NULL) {
-                       int     n;
+                       unsigned int    n;
 
                        if (dp->d_namlen < len + 4)
                                continue;
diff -r 71e550e2f22d -r 333b0336d4f3 lib/libc/compat/net/compat_ns_addr.c
--- a/lib/libc/compat/net/compat_ns_addr.c      Mon Oct 15 18:15:28 2012 +0000
+++ b/lib/libc/compat/net/compat_ns_addr.c      Mon Oct 15 22:22:01 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_ns_addr.c,v 1.2 2012/03/20 17:05:59 matt Exp $  */
+/*     $NetBSD: compat_ns_addr.c,v 1.3 2012/10/15 22:22:01 msaitoh Exp $       */
 
 /*
  * Copyright (c) 1986, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)ns_addr.c  8.1 (Berkeley) 6/7/93";
 #else
-__RCSID("$NetBSD: compat_ns_addr.c,v 1.2 2012/03/20 17:05:59 matt Exp $");
+__RCSID("$NetBSD: compat_ns_addr.c,v 1.3 2012/10/15 22:22:01 msaitoh Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -104,7 +104,8 @@
 Field(char *buf, uint8_t *out, int len)
 {
        register char *bp = buf;
-       int i, ibase, base16 = 0, base10 = 0, clen = 0;
+       int i, ibase, base16 = 0, base10 = 0;
+       unsigned int clen = 0;
        int hb[6], *hp;
 
        _DIAGASSERT(buf != NULL);



Home | Main Index | Thread Index | Old Index