Source-Changes-HG archive

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

[src/trunk]: src/games/fortune/strfile Remove unnecessary casts, and add nece...



details:   https://anonhg.NetBSD.org/src/rev/5e67a3f45f1b
branches:  trunk
changeset: 480473:5e67a3f45f1b
user:      jsm <jsm%NetBSD.org@localhost>
date:      Thu Jan 13 16:22:10 2000 +0000

description:
Remove unnecessary casts, and add necessary ones for printf arguments.

diffstat:

 games/fortune/strfile/strfile.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r ca8b6b2ea75d -r 5e67a3f45f1b games/fortune/strfile/strfile.c
--- a/games/fortune/strfile/strfile.c   Thu Jan 13 16:20:27 2000 +0000
+++ b/games/fortune/strfile/strfile.c   Thu Jan 13 16:22:10 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: strfile.c,v 1.18 2000/01/13 16:20:27 jsm Exp $ */
+/*     $NetBSD: strfile.c,v 1.19 2000/01/13 16:22:10 jsm Exp $ */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -47,7 +47,7 @@
 #if 0
 static char sccsid[] = "@(#)strfile.c  8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: strfile.c,v 1.18 2000/01/13 16:20:27 jsm Exp $");
+__RCSID("$NetBSD: strfile.c,v 1.19 2000/01/13 16:22:10 jsm Exp $");
 #endif
 #endif /* not lint */
 #endif /* __NetBSD__ */
@@ -101,9 +101,9 @@
 
 # define       ALLOC(ptr,sz)   do { \
                        if (ptr == NULL) \
-                               ptr = malloc((unsigned int) (CHUNKSIZE * sizeof *ptr)); \
+                               ptr = malloc(CHUNKSIZE * sizeof *ptr); \
                        else if (((sz) + 1) % CHUNKSIZE == 0) \
-                               ptr = realloc((void *) ptr, ((unsigned int) ((sz) + CHUNKSIZE) * sizeof *ptr)); \
+                               ptr = realloc(ptr, ((sz) + CHUNKSIZE) * sizeof *ptr); \
                        if (ptr == NULL) \
                                die("out of space"); \
                } while (0)
@@ -246,9 +246,9 @@
                        puts("There was 1 string");
                else
                        printf("There were %d strings\n", (int)(Num_pts - 1));
-               printf("Longest string: %lu byte%s\n", Tbl.str_longlen,
+               printf("Longest string: %lu byte%s\n", (unsigned long)Tbl.str_longlen,
                       Tbl.str_longlen == 1 ? "" : "s");
-               printf("Shortest string: %lu byte%s\n", Tbl.str_shortlen,
+               printf("Shortest string: %lu byte%s\n", (unsigned long)Tbl.str_shortlen,
                       Tbl.str_shortlen == 1 ? "" : "s");
        }
 



Home | Main Index | Thread Index | Old Index