Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/number gratuitous (but not harmful) changes to pass gc...



details:   https://anonhg.NetBSD.org/src/rev/383f5e980ff1
branches:  trunk
changeset: 794733:383f5e980ff1
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Mar 23 00:03:04 2014 +0000

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

diffstat:

 games/number/number.c |  22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diffs (72 lines):

diff -r e98463b31134 -r 383f5e980ff1 games/number/number.c
--- a/games/number/number.c     Sat Mar 22 23:47:03 2014 +0000
+++ b/games/number/number.c     Sun Mar 23 00:03:04 2014 +0000
@@ -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 @@
 #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 @@
 
 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 @@
 void
 convert(char *line)
 {
-       int flen, len, rval;
+       size_t flen, len;
+       int rval;
        char *p, *fraction;
 
        flen = 0;
@@ -191,9 +192,10 @@
 }
 
 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 @@
 }
 
 int
-number(const char *p, int len)
+number(const char *p, size_t len)
 {
        int val, rval;
 
@@ -263,7 +265,7 @@
 }
 
 void
-pfract(int len)
+pfract(size_t len)
 {
        static const char *const pref[] = { "", "ten-", "hundred-" };
 



Home | Main Index | Thread Index | Old Index