gratuitous (but not harmful) changes to pass gcc48's -Wconversion

This commit is contained in:
dholland 2014-03-23 00:03:04 +00:00
parent 747644908b
commit b34516b7a7

View File

@ -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 * Copyright (c) 1988, 1993, 1994
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\
#if 0 #if 0
static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -78,9 +78,9 @@ static const char *const name1[] = {
int main(int, char *[]); int main(int, char *[]);
static void convert(char *); static void convert(char *);
static int number(const char *, int); static int number(const char *, size_t);
static void pfract(int); static void pfract(size_t);
static int unit(int, const char *); static int unit(size_t, const char *);
static void usage(void) __dead; static void usage(void) __dead;
static int lflag; static int lflag;
@ -125,7 +125,8 @@ main(int argc, char *argv[])
void void
convert(char *line) convert(char *line)
{ {
int flen, len, rval; size_t flen, len;
int rval;
char *p, *fraction; char *p, *fraction;
flen = 0; flen = 0;
@ -191,9 +192,10 @@ badnum: errx(1, "illegal number: %s", line);
} }
int int
unit(int len, const char *p) unit(size_t len, const char *p)
{ {
int off, rval; size_t off;
int rval;
rval = 0; rval = 0;
if (len > 3) { if (len > 3) {
@ -225,7 +227,7 @@ unit(int len, const char *p)
} }
int int
number(const char *p, int len) number(const char *p, size_t len)
{ {
int val, rval; int val, rval;
@ -263,7 +265,7 @@ number(const char *p, int len)
} }
void void
pfract(int len) pfract(size_t len)
{ {
static const char *const pref[] = { "", "ten-", "hundred-" }; static const char *const pref[] = { "", "ten-", "hundred-" };