Source-Changes-HG archive

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

[src/trunk]: src/lib/libc Fix signed/unsigned comparison warnings.



details:   https://anonhg.NetBSD.org/src/rev/6e862a3b2c74
branches:  trunk
changeset: 539222:6e862a3b2c74
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Nov 11 17:13:59 2002 +0000

description:
Fix signed/unsigned comparison warnings.

diffstat:

 lib/libc/gen/getpwent.c     |  6 +++---
 lib/libc/gmon/gmon.c        |  8 ++++----
 lib/libc/rpc/getnetconfig.c |  9 +++++----
 3 files changed, 12 insertions(+), 11 deletions(-)

diffs (107 lines):

diff -r 05e28aefe093 -r 6e862a3b2c74 lib/libc/gen/getpwent.c
--- a/lib/libc/gen/getpwent.c   Mon Nov 11 17:10:11 2002 +0000
+++ b/lib/libc/gen/getpwent.c   Mon Nov 11 17:13:59 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getpwent.c,v 1.51 2002/05/26 14:03:20 wiz Exp $        */
+/*     $NetBSD: getpwent.c,v 1.52 2002/11/11 17:15:51 thorpej Exp $    */
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)getpwent.c 8.2 (Berkeley) 4/27/95";
 #else
-__RCSID("$NetBSD: getpwent.c,v 1.51 2002/05/26 14:03:20 wiz Exp $");
+__RCSID("$NetBSD: getpwent.c,v 1.52 2002/11/11 17:15:51 thorpej Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1209,7 +1209,7 @@
        SCALAR(_pw_passwd.pw_expire);
 
        /* See if there's any data left.  If so, read in flags. */
-       if (data.size > (p - (char *)data.data)) {
+       if (data.size > (size_t) (p - (char *)data.data)) {
                SCALAR(_pw_flags);
        } else
                _pw_flags = _PASSWORD_NOUID|_PASSWORD_NOGID;    /* default */
diff -r 05e28aefe093 -r 6e862a3b2c74 lib/libc/gmon/gmon.c
--- a/lib/libc/gmon/gmon.c      Mon Nov 11 17:10:11 2002 +0000
+++ b/lib/libc/gmon/gmon.c      Mon Nov 11 17:13:59 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gmon.c,v 1.18 2002/04/26 16:39:52 christos Exp $       */
+/*     $NetBSD: gmon.c,v 1.19 2002/11/11 17:18:47 thorpej Exp $        */
 
 /*-
  * Copyright (c) 1983, 1992, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)gmon.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: gmon.c,v 1.18 2002/04/26 16:39:52 christos Exp $");
+__RCSID("$NetBSD: gmon.c,v 1.19 2002/11/11 17:18:47 thorpej Exp $");
 #endif
 #endif
 
@@ -75,7 +75,7 @@
        u_long lowpc;
        u_long highpc;
 {
-       long o;
+       u_long o;
        char *cp;
        struct gmonparam *p = &_gmonparam;
 
@@ -118,7 +118,7 @@
 #ifndef notdef
                s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
 #else /* avoid floating point */
-               int quot = o / p->kcountsize;
+               u_long quot = o / p->kcountsize;
                
                if (quot >= 0x10000)
                        s_scale = 1;
diff -r 05e28aefe093 -r 6e862a3b2c74 lib/libc/rpc/getnetconfig.c
--- a/lib/libc/rpc/getnetconfig.c       Mon Nov 11 17:10:11 2002 +0000
+++ b/lib/libc/rpc/getnetconfig.c       Mon Nov 11 17:13:59 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getnetconfig.c,v 1.8 2002/11/08 00:13:07 fvdl Exp $    */
+/*     $NetBSD: getnetconfig.c,v 1.9 2002/11/11 17:13:59 thorpej Exp $ */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -45,6 +45,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <netconfig.h>
+#include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 #include <rpc/rpc.h>
@@ -448,7 +449,7 @@
                return (NULL);
        }
        do {
-               int len;
+               ptrdiff_t len;
                char *tmpp;     /* tmp string pointer */
 
                do {
@@ -463,7 +464,7 @@
                        nc_error = NC_BADFILE;
                        break;
                }
-               if (strlen(netid) == (len = tmpp - stringp) &&  /* a match */
+               if (strlen(netid) == (size_t) (len = tmpp - stringp) && /* a match */
                    strncmp(stringp, netid, (size_t)len) == 0) {
                        if ((ncp = (struct netconfig *)
                            malloc(sizeof (struct netconfig))) == NULL)
@@ -645,7 +646,7 @@
 {
        struct netconfig        *p;
        char    *tmp;
-       int     i;
+       u_int   i;
 
        _DIAGASSERT(ncp != NULL);
 



Home | Main Index | Thread Index | Old Index