Fix signed/unsigned comparison warnings.

This commit is contained in:
thorpej 2002-11-11 16:50:34 +00:00
parent 396f36cc12
commit fd128e9fb6
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: getloadavg.c,v 1.11 2000/06/26 15:37:28 mrg Exp $ */
/* $NetBSD: getloadavg.c,v 1.12 2002/11/11 16:58:42 thorpej Exp $ */
/*-
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)getloadavg.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: getloadavg.c,v 1.11 2000/06/26 15:37:28 mrg Exp $");
__RCSID("$NetBSD: getloadavg.c,v 1.12 2002/11/11 16:58:42 thorpej Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -73,6 +73,7 @@ getloadavg(loadavg, nelem)
size_t size;
_DIAGASSERT(loadavg != NULL);
_DIAGASSERT(nelem >= 0);
mib[0] = CTL_VM;
mib[1] = VM_LOADAVG;
@ -80,7 +81,7 @@ getloadavg(loadavg, nelem)
if (sysctl(mib, 2, &loadinfo, &size, NULL, 0) < 0)
return (-1);
nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t));
nelem = MIN((size_t) nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t));
for (i = 0; i < nelem; i++)
loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale;
return (nelem);

View File

@ -1,4 +1,4 @@
/* $NetBSD: gethnamaddr.c,v 1.52 2002/08/27 08:50:49 itojun Exp $ */
/* $NetBSD: gethnamaddr.c,v 1.53 2002/11/11 16:50:34 thorpej Exp $ */
/*
* ++Copyright++ 1985, 1988, 1993
@ -61,7 +61,7 @@
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ";
#else
__RCSID("$NetBSD: gethnamaddr.c,v 1.52 2002/08/27 08:50:49 itojun Exp $");
__RCSID("$NetBSD: gethnamaddr.c,v 1.53 2002/11/11 16:50:34 thorpej Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -659,7 +659,7 @@ gethostbyaddr(addr, len, af)
int af;
{
const u_char *uaddr = (const u_char *)addr;
int size;
socklen_t size;
struct hostent *hp;
static const ns_dtab dtab[] = {
NS_FILES_CB(_gethtbyaddr, NULL)
@ -1280,7 +1280,7 @@ _yphostent(line, af)
char **hap;
int addrok;
int more;
int naddrs;
size_t naddrs;
_DIAGASSERT(line != NULL);