From b90af5ae21ef3ee58eecf742d5f0bda62cff1b7f Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 29 Dec 2009 08:42:58 +0000 Subject: Use ANSI C function declarations. --- games/fortune/strfile/strfile.c | 30 ++++++++++++++++-------------- games/fortune/unstr/unstr.c | 7 ++++--- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'games') diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index 2f09e3d..dd254a3 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -146,7 +146,8 @@ static void usage(void); * CHUNKSIZE blocks; if the latter, we just write each pointer, * and then seek back to the beginning to write in the table. */ -int main(int ac, char *av[]) +int +main(int ac, char *av[]) { char *sp, dc; FILE *inf, *outf; @@ -264,9 +265,8 @@ int main(int ac, char *av[]) /* * This routine evaluates arguments from the command line */ -void getargs(argc, argv) -int argc; -char **argv; +void +getargs(int argc, char **argv) { int ch; @@ -318,7 +318,8 @@ char **argv; } } -void usage() +void +usage(void) { (void) fprintf(stderr, "strfile [-Ciorsx] [-c char] source_file [output_file]\n"); @@ -329,9 +330,8 @@ void usage() * add_offset: * Add an offset to the list, or write it out, as appropriate. */ -void add_offset(fp, off) -FILE *fp; -off_t off; +void +add_offset(FILE *fp, off_t off) { off_t beoff; @@ -349,7 +349,8 @@ off_t off; * do_order: * Order the strings alphabetically (possibly ignoring case). */ -void do_order() +void +do_order(void) { uint32_t i; off_t *lp; @@ -368,8 +369,8 @@ void do_order() Tbl.str_flags |= STR_ORDERED; } -static int stable_collate_range_cmp(c1, c2) - int c1, c2; +static int +stable_collate_range_cmp(int c1, int c2) { static char s1[2], s2[2]; int ret; @@ -385,8 +386,8 @@ static int stable_collate_range_cmp(c1, c2) * cmp_str: * Compare two strings in the file */ -int cmp_str(s1, s2) -const void *s1, *s2; +int +cmp_str(const void *s1, const void *s2) { const STR *p1, *p2; int c1, c2; @@ -441,7 +442,8 @@ const void *s1, *s2; * not to randomize across delimiter boundaries. All * randomization is done within each block. */ -void randomize() +void +randomize(void) { uint32_t cnt, i; off_t tmp; diff --git a/games/fortune/unstr/unstr.c b/games/fortune/unstr/unstr.c index 25996f4..fa7da82 100644 --- a/games/fortune/unstr/unstr.c +++ b/games/fortune/unstr/unstr.c @@ -79,7 +79,8 @@ FILE *Inf, *Dataf; void order_unstr(STRFILE *); /* ARGSUSED */ -int main(int ac, char **av) +int +main(int ac, char **av) { static STRFILE tbl; /* description table */ @@ -109,8 +110,8 @@ int main(int ac, char **av) exit(0); } -void order_unstr(tbl) -STRFILE *tbl; +void +order_unstr(STRFILE *tbl) { uint32_t i; char *sp; -- cgit v1.1