From e94df79c79bccf70213d44fe0fd6b76060cd81f1 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Mon, 4 Apr 2016 19:09:18 +0300 Subject: [PATCH] get rid of GCC warnings. --- fortune-mod/util/rot.c | 1 + fortune-mod/util/strfile.c | 6 +++--- fortune-mod/util/unstr.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fortune-mod/util/rot.c b/fortune-mod/util/rot.c index 3064193..c9d5a95 100644 --- a/fortune-mod/util/rot.c +++ b/fortune-mod/util/rot.c @@ -5,6 +5,7 @@ #include #include +#include int main(void) { diff --git a/fortune-mod/util/strfile.c b/fortune-mod/util/strfile.c index 5737485..0441fc9 100644 --- a/fortune-mod/util/strfile.c +++ b/fortune-mod/util/strfile.c @@ -411,7 +411,7 @@ void randomize(void) */ int main(int ac, char **av) { - register unsigned char *sp; + register char *sp; register FILE *inf, *outf; register int32_t last_off, length, pos, *p; register int first, cnt; @@ -513,9 +513,9 @@ int main(int ac, char **av) puts("There was 1 string"); else printf("There were %ld strings\n", 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"); } } diff --git a/fortune-mod/util/unstr.c b/fortune-mod/util/unstr.c index baef736..769df40 100644 --- a/fortune-mod/util/unstr.c +++ b/fortune-mod/util/unstr.c @@ -95,6 +95,7 @@ static char sccsid[] = "@(#)unstr.c 8.1 (Berkeley) 5/31/93"; #include #include #include +#include #include #ifndef MAXPATHLEN @@ -174,7 +175,7 @@ void order_unstr(tbl) register STRFILE *tbl; { register int i; - register unsigned char *sp; + register char *sp; auto int32_t pos; char buf[BUFSIZ]; int printedsome; -- 2.40.0