summaryrefslogtreecommitdiffstats
path: root/fortune
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-18 19:38:46 +0000
committerjsm <jsm@NetBSD.org>1999-09-18 19:38:46 +0000
commit623e5e8eddc42ee4e3cff7c418dc2d3d4e96193f (patch)
tree75e04a7aee754535f179cbf6b43570d46e5e75e7 /fortune
parentfa213838b361bf110cedaa5fd78622fe38c911e2 (diff)
downloadbsdgames-darwin-623e5e8eddc42ee4e3cff7c418dc2d3d4e96193f.tar.gz
bsdgames-darwin-623e5e8eddc42ee4e3cff7c418dc2d3d4e96193f.tar.zst
bsdgames-darwin-623e5e8eddc42ee4e3cff7c418dc2d3d4e96193f.zip
Fix -Wsign-compare warnings.
Diffstat (limited to 'fortune')
-rw-r--r--fortune/fortune/fortune.c12
-rw-r--r--fortune/strfile/strfile.c8
-rw-r--r--fortune/unstr/unstr.c6
3 files changed, 13 insertions, 13 deletions
diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c
index 272c84cb..0becbb17 100644
--- a/fortune/fortune/fortune.c
+++ b/fortune/fortune/fortune.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fortune.c,v 1.19 1999/09/09 17:30:19 jsm Exp $ */
+/* $NetBSD: fortune.c,v 1.20 1999/09/18 19:38:49 jsm Exp $ */
/*-
* Copyright (c) 1986, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\
#if 0
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fortune.c,v 1.19 1999/09/09 17:30:19 jsm Exp $");
+__RCSID("$NetBSD: fortune.c,v 1.20 1999/09/18 19:38:49 jsm Exp $");
#endif
#endif /* not lint */
@@ -970,7 +970,7 @@ get_fort()
choice = random() % Noprob_tbl.str_numstr;
DPRINTF(1, (stderr, "choice = %d (of %d) \n", choice,
Noprob_tbl.str_numstr));
- while (choice >= fp->tbl.str_numstr) {
+ while ((u_int32_t)choice >= fp->tbl.str_numstr) {
choice -= fp->tbl.str_numstr;
fp = fp->next;
DPRINTF(1, (stderr,
@@ -1022,7 +1022,7 @@ pick_child(parent)
choice = random() % parent->tbl.str_numstr;
DPRINTF(1, (stderr, " choice = %d (of %d)\n",
choice, parent->tbl.str_numstr));
- for (fp = parent->child; choice >= fp->tbl.str_numstr;
+ for (fp = parent->child; (u_int32_t)choice >= fp->tbl.str_numstr;
fp = fp->next) {
choice -= fp->tbl.str_numstr;
DPRINTF(1, (stderr, "\tskip %s, %d (choice = %d)\n",
@@ -1113,7 +1113,7 @@ get_pos(fp)
fp->pos = random() % fp->tbl.str_numstr;
#endif /* OK_TO_WRITE_DISK */
}
- if (++(fp->pos) >= fp->tbl.str_numstr)
+ if ((u_int64_t)++(fp->pos) >= fp->tbl.str_numstr)
fp->pos -= fp->tbl.str_numstr;
DPRINTF(1, (stderr, "pos for %s is %qd\n", fp->name, fp->pos));
}
@@ -1298,7 +1298,7 @@ maxlen_in_list(list)
}
else {
get_tbl(fp);
- if (fp->tbl.str_longlen > maxlen)
+ if (fp->tbl.str_longlen > (u_int32_t)maxlen)
maxlen = fp->tbl.str_longlen;
}
}
diff --git a/fortune/strfile/strfile.c b/fortune/strfile/strfile.c
index 5c8954e1..f8ff4a2f 100644
--- a/fortune/strfile/strfile.c
+++ b/fortune/strfile/strfile.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strfile.c,v 1.13 1999/09/10 00:18:21 jsm Exp $ */
+/* $NetBSD: strfile.c,v 1.14 1999/09/18 19:38:50 jsm Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: strfile.c,v 1.13 1999/09/10 00:18:21 jsm Exp $");
+__RCSID("$NetBSD: strfile.c,v 1.14 1999/09/18 19:38:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -198,9 +198,9 @@ main(ac, av)
if (!length)
continue;
add_offset(outf, pos);
- if (Tbl.str_longlen < length)
+ if ((off_t)Tbl.str_longlen < length)
Tbl.str_longlen = length;
- if (Tbl.str_shortlen > length)
+ if ((off_t)Tbl.str_shortlen > length)
Tbl.str_shortlen = length;
first = Oflag;
}
diff --git a/fortune/unstr/unstr.c b/fortune/unstr/unstr.c
index b851c40f..fcd327e9 100644
--- a/fortune/unstr/unstr.c
+++ b/fortune/unstr/unstr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: unstr.c,v 1.6 1999/09/08 21:57:17 jsm Exp $ */
+/* $NetBSD: unstr.c,v 1.7 1999/09/18 19:38:50 jsm Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)unstr.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: unstr.c,v 1.6 1999/09/08 21:57:17 jsm Exp $");
+__RCSID("$NetBSD: unstr.c,v 1.7 1999/09/18 19:38:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -133,7 +133,7 @@ void
order_unstr(tbl)
STRFILE *tbl;
{
- int i;
+ unsigned int i;
char *sp;
off_t pos;
char buf[BUFSIZ];