From d6e3c04143b1f4162ba5c26857f42b5c76a4f967 Mon Sep 17 00:00:00 2001 From: thorpej Date: Mon, 11 Nov 2002 20:34:10 +0000 Subject: [PATCH] Fix signed/unsigned comparison warnings. --- lib/libc/locale/rune.c | 10 +++++----- lib/libc/rpc/rpc_generic.c | 6 +++--- lib/libc/stdlib/setenv.c | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c index 5ab7670ec1f6..a52684b45496 100644 --- a/lib/libc/locale/rune.c +++ b/lib/libc/locale/rune.c @@ -1,4 +1,4 @@ -/* $NetBSD: rune.c,v 1.15 2002/03/18 11:34:40 yamt Exp $ */ +/* $NetBSD: rune.c,v 1.16 2002/11/11 20:37:29 thorpej Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)rune.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: rune.c,v 1.15 2002/03/18 11:34:40 yamt Exp $"); +__RCSID("$NetBSD: rune.c,v 1.16 2002/11/11 20:37:29 thorpej Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -90,7 +90,7 @@ static int readrange(_RuneLocale *rl, _RuneRange *rr, _FileRuneRange *frr, void *lastp, FILE *fp) { - int i; + uint32_t i; _RuneEntry *re; _FileRuneEntry fre; @@ -199,7 +199,7 @@ void _freeentry(_RuneRange *rr) { _RuneEntry *re; - int i; + uint32_t i; _DIAGASSERT(rr != NULL); @@ -410,7 +410,7 @@ _Read_CTypeAsRune(fp) rl->rl_variable_len = 0; for (x = 0; x < _CACHED_RUNES; ++x) { - if (x > len) + if ((uint32_t) x > len) continue; /* diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c index 029e87d2357c..c204b5541a84 100644 --- a/lib/libc/rpc/rpc_generic.c +++ b/lib/libc/rpc/rpc_generic.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_generic.c,v 1.10 2002/11/08 00:13:07 fvdl Exp $ */ +/* $NetBSD: rpc_generic.c,v 1.11 2002/11/11 20:34:10 thorpej Exp $ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for @@ -537,7 +537,7 @@ __rpc_fd2sockinfo(int fd, struct __rpc_sockinfo *sip) int __rpc_nconf2sockinfo(const struct netconfig *nconf, struct __rpc_sockinfo *sip) { - int i; + size_t i; _DIAGASSERT(nconf != NULL); _DIAGASSERT(sip != NULL); @@ -573,7 +573,7 @@ __rpc_nconf2fd(const struct netconfig *nconf) int __rpc_sockinfo2netid(struct __rpc_sockinfo *sip, const char **netid) { - int i; + size_t i; _DIAGASSERT(sip != NULL); /* netid may be NULL */ diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c index a4e8db554494..45fe09122ba3 100644 --- a/lib/libc/stdlib/setenv.c +++ b/lib/libc/stdlib/setenv.c @@ -1,4 +1,4 @@ -/* $NetBSD: setenv.c,v 1.19 2000/12/20 18:38:30 christos Exp $ */ +/* $NetBSD: setenv.c,v 1.20 2002/11/11 20:39:12 thorpej Exp $ */ /* * Copyright (c) 1987, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)setenv.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: setenv.c,v 1.19 2000/12/20 18:38:30 christos Exp $"); +__RCSID("$NetBSD: setenv.c,v 1.20 2002/11/11 20:39:12 thorpej Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -76,7 +76,8 @@ setenv(name, value, rewrite) static int alloced; /* if allocated space before */ char *c; const char *cc; - int l_value, offset; + size_t l_value; + int offset; _DIAGASSERT(name != NULL); _DIAGASSERT(value != NULL);