Fix -Wsign-compare issues

This commit is contained in:
lukem 2009-04-15 00:13:50 +00:00
parent c1ceae17f0
commit 7affd6558f
12 changed files with 35 additions and 35 deletions

View File

@ -1,11 +1,9 @@
# $NetBSD: Makefile,v 1.9 2008/05/03 14:48:31 lukem Exp $
# $NetBSD: Makefile,v 1.10 2009/04/15 00:13:50 lukem Exp $
LIBISPRIVATE= yes
.include <bsd.own.mk>
#WARNS= 2
LIB= altq
SRCS= parser.c qop.c qop_blue.c qop_cbq.c qop_cdnr.c qop_conf.c \
qop_dummy.c qop_errlist.c qop_fifoq.c qop_hfsc.c qop_jobs.c \

View File

@ -1,4 +1,4 @@
/* $NetBSD: qop_cbq.c,v 1.7 2008/05/02 19:07:44 xtraeme Exp $ */
/* $NetBSD: qop_cbq.c,v 1.8 2009/04/15 00:13:51 lukem Exp $ */
/* $KAME: qop_cbq.c,v 1.7 2002/05/31 06:03:35 kjc Exp $ */
/*
* Copyright (c) Sun Microsystems, Inc. 1993-1998 All rights reserved.
@ -421,9 +421,10 @@ qcmd_cbq_add_ctl_filters(const char *ifname, const char *clname)
struct flow_filter6 sfilt6;
u_int8_t ctl6_protos[3] = {IPPROTO_ICMPV6, IPPROTO_IGMP, IPPROTO_RSVP};
#endif
int error, i;
int error;
size_t i;
for (i = 0; i < (int)sizeof(ctl_protos); i++) {
for (i = 0; i < sizeof(ctl_protos); i++) {
memset(&sfilt, 0, sizeof(sfilt));
sfilt.ff_flow.fi_family = AF_INET;
sfilt.ff_flow.fi_proto = ctl_protos[i];

View File

@ -1,4 +1,4 @@
/* $NetBSD: quip_server.c,v 1.4 2001/08/22 08:52:37 itojun Exp $ */
/* $NetBSD: quip_server.c,v 1.5 2009/04/15 00:13:51 lukem Exp $ */
/* $KAME: quip_server.c,v 1.6 2001/08/20 06:41:32 kjc Exp $ */
/*
* Copyright (C) 1999-2000
@ -154,7 +154,7 @@ next_word(char **cpp, char *b)
return(0);
tp = strpbrk(*cpp, " \t\n#");
L = MIN((tp)?(tp-*cpp):strlen(*cpp), 63);
L = MIN((tp)?(tp-*cpp):(int)strlen(*cpp), 63);
strncpy(b, *cpp, L);
*(b + L) = '\0';
*cpp += L;

View File

@ -22,7 +22,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: bootpd.c,v 1.22 2008/05/02 19:22:10 xtraeme Exp $");
__RCSID("$NetBSD: bootpd.c,v 1.23 2009/04/15 00:23:28 lukem Exp $");
#endif
/*
@ -519,7 +519,7 @@ main(int argc, char **argv)
report(LOG_INFO, "recvd pkt from IP addr %s",
inet_ntoa(recv_addr.sin_addr));
}
if (n < sizeof(struct bootp)) {
if (n < (int)sizeof(struct bootp)) {
if (debug) {
report(LOG_INFO, "received short packet");
}
@ -1224,7 +1224,7 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
* a response of that same length where the additional length
* is assumed to be part of the bp_vend (options) area.
*/
if (pktlen > sizeof(*bp)) {
if (pktlen > (int)sizeof(*bp)) {
if (debug > 1)
report(LOG_INFO, "request message length=%d", pktlen);
}
@ -1265,7 +1265,7 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
p += llen;
}
if (msgsz > sizeof(*bp)) {
if (msgsz > (int)sizeof(*bp)) {
if (debug > 1)
report(LOG_INFO, "request has DHCP msglen=%d", msgsz);
pktlen = msgsz;
@ -1273,12 +1273,12 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
}
}
if (pktlen < sizeof(*bp)) {
if (pktlen < (int)sizeof(*bp)) {
report(LOG_ERR, "invalid response length=%d", pktlen);
pktlen = sizeof(*bp);
}
bytesleft = ((byte*)bp + pktlen) - vp;
if (pktlen > sizeof(*bp)) {
if (pktlen > (int)sizeof(*bp)) {
if (debug > 1)
report(LOG_INFO, "extended reply, length=%d, options=%d",
pktlen, bytesleft);
@ -1304,7 +1304,7 @@ dovend_rfc1048(struct bootp *bp, struct host *hp, int32 bootsize)
if (hp->flags.bootsize) {
/* always enough room here */
bootsize = (hp->flags.bootsize_auto) ?
((bootsize + 511) / 512) : (hp->bootsize); /* Round up */
((bootsize + 511) / 512) : ((int32_t)hp->bootsize); /* Round up */
*vp++ = TAG_BOOT_SIZE;
*vp++ = 2;
*vp++ = (byte) ((bootsize >> 8) & 0xFF);

View File

@ -22,7 +22,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: bootpef.c,v 1.8 2008/05/02 19:22:10 xtraeme Exp $");
__RCSID("$NetBSD: bootpef.c,v 1.9 2009/04/15 00:23:28 lukem Exp $");
#endif
@ -306,7 +306,7 @@ mktagfile(struct host *hp)
return;
}
len = vp - buffer;
if (len != fwrite(buffer, 1, len, fp)) {
if ((size_t)len != fwrite(buffer, 1, len, fp)) {
report(LOG_ERR, "write failed on \"%s\" : %s",
hp->exten_file->string, get_errmsg());
}

View File

@ -27,7 +27,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: bootpgw.c,v 1.13 2007/05/27 16:31:42 tls Exp $");
__RCSID("$NetBSD: bootpgw.c,v 1.14 2009/04/15 00:23:28 lukem Exp $");
#endif
/*
@ -449,7 +449,7 @@ main(int argc, char **argv)
report(LOG_INFO, "recvd pkt from IP addr %s",
inet_ntoa(clnt_addr.sin_addr));
}
if (n < sizeof(struct bootp)) {
if (n < (int)sizeof(struct bootp)) {
if (debug) {
report(LOG_INFO, "received short packet");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: bootptest.c,v 1.17 2008/05/02 19:22:10 xtraeme Exp $ */
/* $NetBSD: bootptest.c,v 1.18 2009/04/15 00:23:29 lukem Exp $ */
/*
* bootptest.c - Test out a bootp server.
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: bootptest.c,v 1.17 2008/05/02 19:22:10 xtraeme Exp $");
__RCSID("$NetBSD: bootptest.c,v 1.18 2009/04/15 00:23:29 lukem Exp $");
#endif
const char *usage = "usage: %s [-f bootfile] [-h] [-m magic_number] server-name\n"
@ -407,7 +407,7 @@ main(int argc, char **argv)
if (n <= 0) {
continue;
}
if (n < sizeof(struct bootp)) {
if (n < (int)sizeof(struct bootp)) {
printf("received short packet\n");
continue;
}

View File

@ -1,8 +1,8 @@
/* $NetBSD: getether.c,v 1.8 2007/05/27 16:31:42 tls Exp $ */
/* $NetBSD: getether.c,v 1.9 2009/04/15 00:23:29 lukem Exp $ */
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: getether.c,v 1.8 2007/05/27 16:31:42 tls Exp $");
__RCSID("$NetBSD: getether.c,v 1.9 2009/04/15 00:23:29 lukem Exp $");
#endif
/*
@ -141,7 +141,7 @@ getether(char *ifname, char *eap)
ifc.ifc_len = sizeof(ibuf);
ifc.ifc_buf = (caddr_t) ibuf;
if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 ||
ifc.ifc_len < sizeof(struct ifreq)) {
ifc.ifc_len < (int)sizeof(struct ifreq)) {
report(LOG_ERR, "getether: SIOCGIFCONF: %s", get_errmsg());
goto out;
}
@ -159,7 +159,7 @@ getether(char *ifname, char *eap)
}
/* Bump interface config pointer */
n = ifrp->ifr_addr.sa_len + sizeof(ifrp->ifr_name);
if (n < sizeof(*ifrp))
if (n < (int)sizeof(*ifrp))
n = sizeof(*ifrp);
ifrp = (struct ifreq *) ((char *) ifrp + n);
}

View File

@ -26,7 +26,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: print-bootp.c,v 1.9 2008/05/02 19:22:10 xtraeme Exp $");
__RCSID("$NetBSD: print-bootp.c,v 1.10 2009/04/15 00:23:29 lukem Exp $");
/* 93/10/10 <gwr@mc.com> New data-driven option print routine. */
#endif
@ -380,7 +380,7 @@ cmu_print(u_char *bp, int length)
printf("-cmu");
v = (struct cmu_vend *) bp;
if (length < sizeof(*v)) {
if (length < (int)sizeof(*v)) {
printf(" |L=%d", length);
return;
}

View File

@ -1,8 +1,8 @@
/* $NetBSD: hwaddr.c,v 1.9 2007/05/27 16:31:42 tls Exp $ */
/* $NetBSD: hwaddr.c,v 1.10 2009/04/15 00:23:29 lukem Exp $ */
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: hwaddr.c,v 1.9 2007/05/27 16:31:42 tls Exp $");
__RCSID("$NetBSD: hwaddr.c,v 1.10 2009/04/15 00:23:29 lukem Exp $");
#endif
/*
@ -59,7 +59,7 @@ struct hwinfo hwinfolist[] =
{6, "IEEE 802"}, /* Type 6: IEEE 802 Networks */
{0, "ARCNET"} /* Type 7: ARCNET */
};
int hwinfocnt = sizeof(hwinfolist) / sizeof(hwinfolist[0]);
size_t hwinfocnt = sizeof(hwinfolist) / sizeof(hwinfolist[0]);
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: hwaddr.h,v 1.5 2008/05/02 19:22:10 xtraeme Exp $ */
/* $NetBSD: hwaddr.h,v 1.6 2009/04/15 00:23:29 lukem Exp $ */
/* hwaddr.h */
#ifndef HWADDR_H
@ -17,7 +17,7 @@ struct hwinfo {
};
extern struct hwinfo hwinfolist[];
extern int hwinfocnt;
extern size_t hwinfocnt;
extern void setarp(int, struct in_addr *, u_char *, int);
extern char *haddrtoa(u_char *, int);

View File

@ -22,7 +22,7 @@ SOFTWARE.
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: readfile.c,v 1.16 2008/05/02 19:22:10 xtraeme Exp $");
__RCSID("$NetBSD: readfile.c,v 1.17 2009/04/15 00:23:29 lukem Exp $");
#endif
@ -495,7 +495,8 @@ readtab(int force)
PRIVATE void
read_entry(FILE *fp, char *buffer, unsigned int *bufsiz)
{
int c, length;
int c;
unsigned int length;
length = 0;