Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libterm Fix signed/unsigned comparison warnings.
details: https://anonhg.NetBSD.org/src/rev/6bd9f643e5d1
branches: trunk
changeset: 539243:6bd9f643e5d1
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Nov 11 23:56:46 2002 +0000
description:
Fix signed/unsigned comparison warnings.
diffstat:
lib/libterm/termcap.c | 13 +++++++------
lib/libterm/tputs.c | 10 ++++++----
2 files changed, 13 insertions(+), 10 deletions(-)
diffs (88 lines):
diff -r 50346c7c1ebb -r 6bd9f643e5d1 lib/libterm/termcap.c
--- a/lib/libterm/termcap.c Mon Nov 11 23:43:03 2002 +0000
+++ b/lib/libterm/termcap.c Mon Nov 11 23:56:46 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: termcap.c,v 1.44 2002/06/19 15:56:27 christos Exp $ */
+/* $NetBSD: termcap.c,v 1.45 2002/11/11 23:56:46 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)termcap.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: termcap.c,v 1.44 2002/06/19 15:56:27 christos Exp $");
+__RCSID("$NetBSD: termcap.c,v 1.45 2002/11/11 23:56:46 thorpej Exp $");
#endif
#endif /* not lint */
@@ -165,10 +165,10 @@
p += strlen(home); /* path, looking in */
(void)strlcpy(pathbuf, home,
sizeof(pathbuf)); /* $HOME first */
- if ((p - pathbuf) < sizeof(pathbuf) - 1)
+ if ((size_t)(p - pathbuf) < sizeof(pathbuf) - 1)
*p++ = '/';
} /* if no $HOME look in current directory */
- if ((p - pathbuf) < sizeof(pathbuf) - 1) {
+ if ((size_t)(p - pathbuf) < sizeof(pathbuf) - 1) {
(void)strlcpy(p, _PATH_DEF,
sizeof(pathbuf) - (p - pathbuf));
}
@@ -407,7 +407,7 @@
* check if there is room for the new entry to be put into
* area
*/
- if (limit != NULL && (*limit < i)) {
+ if (limit != NULL && (*limit < (size_t) i)) {
errno = E2BIG;
free(s);
return NULL;
@@ -490,7 +490,8 @@
if (new_size == 0)
return NULL;
- if ((tb = info->tbuf) == NULL || (tb->eptr - tb->ptr) < (new_size + 1)) {
+ if ((tb = info->tbuf) == NULL ||
+ (size_t) (tb->eptr - tb->ptr) < (new_size + 1)) {
if (new_size < BSIZE)
new_size = BSIZE;
else
diff -r 50346c7c1ebb -r 6bd9f643e5d1 lib/libterm/tputs.c
--- a/lib/libterm/tputs.c Mon Nov 11 23:43:03 2002 +0000
+++ b/lib/libterm/tputs.c Mon Nov 11 23:56:46 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tputs.c,v 1.19 2001/01/23 15:56:46 jdolecek Exp $ */
+/* $NetBSD: tputs.c,v 1.20 2002/11/11 23:56:46 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)tputs.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tputs.c,v 1.19 2001/01/23 15:56:46 jdolecek Exp $");
+__RCSID("$NetBSD: tputs.c,v 1.20 2002/11/11 23:56:46 thorpej Exp $");
#endif
#endif /* not lint */
@@ -139,7 +139,8 @@
*/
if (i == 0)
return;
- if (ospeed <= 0 || ospeed >= (sizeof tmspc10 / sizeof tmspc10[0]))
+ if (ospeed <= 0 ||
+ (size_t) ospeed >= (sizeof tmspc10 / sizeof tmspc10[0]))
return;
/*
@@ -208,7 +209,8 @@
*/
if (i == 0)
return 0;
- if (ospeed <= 0 || ospeed >= (sizeof tmspc10 / sizeof tmspc10[0]))
+ if (ospeed <= 0 ||
+ (size_t) ospeed >= (sizeof tmspc10 / sizeof tmspc10[0]))
return 0;
/*
Home |
Main Index |
Thread Index |
Old Index