diff options
author | dholland <dholland@NetBSD.org> | 2014-03-23 00:03:04 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2014-03-23 00:03:04 +0000 |
commit | ea4ab94b8b2541726e287b272223b3db9875a4fd (patch) | |
tree | 95afe3d0329d142df76c615c46d9fdbb11ae8274 | |
parent | b773bb0aba7a99de02ba15329a4a8388125d0542 (diff) | |
download | bsdgames-darwin-ea4ab94b8b2541726e287b272223b3db9875a4fd.tar.gz bsdgames-darwin-ea4ab94b8b2541726e287b272223b3db9875a4fd.tar.zst bsdgames-darwin-ea4ab94b8b2541726e287b272223b3db9875a4fd.zip |
gratuitous (but not harmful) changes to pass gcc48's -Wconversion
-rw-r--r-- | number/number.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/number/number.c b/number/number.c index 5cf41705..0e7fbb03 100644 --- a/number/number.c +++ b/number/number.c @@ -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, 1993, 1994\ #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", line); } 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-" }; |