Module Name: src
Committed By: dholland
Date: Sun Mar 23 00:03:05 UTC 2014
Modified Files:
src/games/number: number.c
Log Message:
gratuitous (but not harmful) changes to pass gcc48's -Wconversion
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/games/number/number.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/number/number.c
diff -u src/games/number/number.c:1.15 src/games/number/number.c:1.16
--- src/games/number/number.c:1.15 Tue Jun 19 05:46:09 2012
+++ src/games/number/number.c Sun Mar 23 00:03:04 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: number.c,v 1.15 2012/06/19 05:46:09 dholland Exp $ */
+/* $NetBSD: number.c,v 1.16 2014/03/23 00:03:04 dholland Exp $ */
/*
* Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
#if 0
static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: number.c,v 1.15 2012/06/19 05:46:09 dholland Exp $");
+__RCSID("$NetBSD: number.c,v 1.16 2014/03/23 00:03:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -78,9 +78,9 @@ static const char *const name1[] = {
int main(int, char *[]);
static void convert(char *);
-static int number(const char *, int);
-static void pfract(int);
-static int unit(int, const char *);
+static int number(const char *, size_t);
+static void pfract(size_t);
+static int unit(size_t, const char *);
static void usage(void) __dead;
static int lflag;
@@ -125,7 +125,8 @@ main(int argc, char *argv[])
void
convert(char *line)
{
- int flen, len, rval;
+ size_t flen, len;
+ int rval;
char *p, *fraction;
flen = 0;
@@ -191,9 +192,10 @@ badnum: errx(1, "illegal number: %s",
}
int
-unit(int len, const char *p)
+unit(size_t len, const char *p)
{
- int off, rval;
+ size_t off;
+ int rval;
rval = 0;
if (len > 3) {
@@ -225,7 +227,7 @@ unit(int len, const char *p)
}
int
-number(const char *p, int len)
+number(const char *p, size_t len)
{
int val, rval;
@@ -263,7 +265,7 @@ number(const char *p, int len)
}
void
-pfract(int len)
+pfract(size_t len)
{
static const char *const pref[] = { "", "ten-", "hundred-" };