Skip to content

Commit 25e5961

Browse files
author
thorpej
committed
Fix signed/unsigned comparison warnings.
1 parent 661886e commit 25e5961

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

lib/libc/db/btree/bt_open.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: bt_open.c,v 1.15 2002/04/16 19:00:45 groo Exp $ */
1+
/* $NetBSD: bt_open.c,v 1.16 2002/11/11 01:17:20 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993, 1994
@@ -41,7 +41,7 @@
4141
#if 0
4242
static char sccsid[] = "@(#)bt_open.c 8.10 (Berkeley) 8/17/94";
4343
#else
44-
__RCSID("$NetBSD: bt_open.c,v 1.15 2002/04/16 19:00:45 groo Exp $");
44+
__RCSID("$NetBSD: bt_open.c,v 1.16 2002/11/11 01:17:20 thorpej Exp $");
4545
#endif
4646
#endif /* LIBC_SCCS and not lint */
4747

@@ -397,7 +397,8 @@ static int
397397
tmp()
398398
{
399399
sigset_t set, oset;
400-
int fd, len;
400+
size_t len;
401+
int fd;
401402
char *envtmp;
402403
char path[PATH_MAX];
403404

lib/libc/gen/arc4random.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: arc4random.c,v 1.4 2002/07/02 17:10:19 itojun Exp $ */
1+
/* $NetBSD: arc4random.c,v 1.5 2002/11/11 01:13:07 thorpej Exp $ */
22
/* $OpenBSD: arc4random.c,v 1.6 2001/06/05 05:05:38 pvalchev Exp $ */
33

44
/*
@@ -105,7 +105,8 @@ arc4_stir(as)
105105
}
106106
#ifdef KERN_URND
107107
else {
108-
int i, mib[2];
108+
int mib[2];
109+
u_int i;
109110
size_t len;
110111

111112
/* Device could not be opened, we might be chrooted, take
@@ -114,7 +115,7 @@ arc4_stir(as)
114115
mib[0] = CTL_KERN;
115116
mib[1] = KERN_URND;
116117

117-
for (i = 0; i < sizeof(rdat.rnd) / sizeof(u_int); i ++) {
118+
for (i = 0; i < sizeof(rdat.rnd) / sizeof(u_int); i++) {
118119
len = sizeof(u_int);
119120
if (sysctl(mib, 2, &rdat.rnd[i], &len, NULL, 0) == -1)
120121
break;

lib/libc/net/base64.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: base64.c,v 1.7 2000/07/07 08:03:38 itohy Exp $ */
1+
/* $NetBSD: base64.c,v 1.8 2002/11/11 01:15:17 thorpej Exp $ */
22

33
/*
44
* Copyright (c) 1996 by Internet Software Consortium.
@@ -44,7 +44,7 @@
4444

4545
#include <sys/cdefs.h>
4646
#if defined(LIBC_SCCS) && !defined(lint)
47-
__RCSID("$NetBSD: base64.c,v 1.7 2000/07/07 08:03:38 itohy Exp $");
47+
__RCSID("$NetBSD: base64.c,v 1.8 2002/11/11 01:15:17 thorpej Exp $");
4848
#endif /* LIBC_SCCS and not lint */
4949

5050
#include <sys/types.h>
@@ -145,7 +145,7 @@ b64_ntop(src, srclength, target, targsize)
145145
size_t datalength = 0;
146146
u_char input[3];
147147
u_char output[4];
148-
int i;
148+
size_t i;
149149

150150
_DIAGASSERT(src != NULL);
151151
_DIAGASSERT(target != NULL);
@@ -219,7 +219,8 @@ b64_pton(src, target, targsize)
219219
u_char *target;
220220
size_t targsize;
221221
{
222-
int tarindex, state, ch;
222+
size_t tarindex;
223+
int state, ch;
223224
char *pos;
224225

225226
_DIAGASSERT(src != NULL);

lib/libc/string/__strerror.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: __strerror.c,v 1.18 2002/02/13 08:05:12 yamt Exp $ */
1+
/* $NetBSD: __strerror.c,v 1.19 2002/11/11 01:12:04 thorpej Exp $ */
22

33
/*
44
* Copyright (c) 1988 Regents of the University of California.
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91";
4040
#else
41-
__RCSID("$NetBSD: __strerror.c,v 1.18 2002/02/13 08:05:12 yamt Exp $");
41+
__RCSID("$NetBSD: __strerror.c,v 1.19 2002/11/11 01:12:04 thorpej Exp $");
4242
#endif
4343
#endif /* LIBC_SCCS and not lint */
4444

@@ -77,7 +77,7 @@ __strerror(num, buf, buflen)
7777
_DIAGASSERT(buf != NULL);
7878

7979
errnum = num; /* convert to unsigned */
80-
if (errnum < sys_nerr) {
80+
if (errnum < (unsigned int) sys_nerr) {
8181
#ifdef NLS
8282
(void)strncpy(buf, catgets(catd, 1, (int)errnum,
8383
sys_errlist[errnum]), buflen);

lib/libc/string/__strsignal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: __strsignal.c,v 1.21 2002/03/20 01:43:55 christos Exp $ */
1+
/* $NetBSD: __strsignal.c,v 1.22 2002/11/11 01:12:04 thorpej Exp $ */
22

33
/*
44
* Copyright (c) 1988 Regents of the University of California.
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91";
4040
#else
41-
__RCSID("$NetBSD: __strsignal.c,v 1.21 2002/03/20 01:43:55 christos Exp $");
41+
__RCSID("$NetBSD: __strsignal.c,v 1.22 2002/11/11 01:12:04 thorpej Exp $");
4242
#endif
4343
#endif /* LIBC_SCCS and not lint */
4444

@@ -77,7 +77,7 @@ __strsignal(num, buf, buflen)
7777
_DIAGASSERT(buf != NULL);
7878

7979
signum = num; /* convert to unsigned */
80-
if (signum < sys_nsig) {
80+
if (signum < (unsigned int) sys_nsig) {
8181
#ifdef NLS
8282
(void)strncpy(buf, catgets(catd, 2, (int)signum,
8383
sys_siglist[signum]), NL_TEXTMAX);

0 commit comments

Comments
 (0)