From 8a07407d0f2ad3fef58c74bcfb951cf3d48e1ddd Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Fri, 19 Nov 2021 11:03:53 +0200 Subject: [PATCH] Rename variable/s to make them more descriptive. --- fortune-mod/util/randstr.c | 12 ++++++------ fortune-mod/util/strfile.c | 4 ++-- fortune-mod/util/unstr.c | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/fortune-mod/util/randstr.c b/fortune-mod/util/randstr.c index 5d98446..5f3922e 100644 --- a/fortune-mod/util/randstr.c +++ b/fortune-mod/util/randstr.c @@ -96,13 +96,13 @@ static off_t pos, Seekpts[2]; /* seek pointers to fortunes */ #include "fortune-util.h" -static void getargs(char *av[]) +static void getargs(char *argv[]) { - av += optind + 1; + argv += optind + 1; - if (*av) + if (*argv) { - input_filename = *av; + input_filename = *argv; input_fn_2_data_fn(); } else @@ -167,11 +167,11 @@ static void display(FILE *fp, STRFILE table) fflush(stdout); } -int main(int ac GCC_UNUSED, char **av) +int main(int argc GCC_UNUSED, char **argv) { static STRFILE tbl; /* description table */ - getargs(av); + getargs(argv); if (!(Inf = fopen(input_filename, "r"))) { perror(input_filename); diff --git a/fortune-mod/util/strfile.c b/fortune-mod/util/strfile.c index 96188f8..2333dba 100644 --- a/fortune-mod/util/strfile.c +++ b/fortune-mod/util/strfile.c @@ -355,13 +355,13 @@ static void randomize(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 argc, char **argv) { char *sp; FILE *inf, *outf; bool len_was_set = false; - getargs(ac, av); /* evalute arguments */ + getargs(argc, argv); /* evalute arguments */ if (!(inf = fopen(input_filename, "r"))) { perror(input_filename); diff --git a/fortune-mod/util/unstr.c b/fortune-mod/util/unstr.c index 39b5928..de61bee 100644 --- a/fortune-mod/util/unstr.c +++ b/fortune-mod/util/unstr.c @@ -87,11 +87,11 @@ static FILE *Inf, *Dataf, *Outf; #include "fortune-util.h" /* ARGSUSED */ -static void getargs(int ac, char *av[]) +static void getargs(int argc, char *argv[]) { int ch; - while ((ch = getopt(ac, av, "c:")) != EOF) + while ((ch = getopt(argc, argv, "c:")) != EOF) switch (ch) { case 'c': @@ -109,13 +109,13 @@ static void getargs(int ac, char *av[]) exit(1); } - av += optind; + argv += optind; - if (*av) + if (*argv) { - input_filename = *av; + input_filename = *argv; input_fn_2_data_fn(); - set_output_filename(*++av); + set_output_filename(*++argv); } else { @@ -166,11 +166,11 @@ static void order_unstr(STRFILE *tbl) } } -int main(int ac, char **av) +int main(int argc, char **argv) { static STRFILE tbl; /* description table */ - getargs(ac, av); + getargs(argc, argv); if (!(Inf = fopen(input_filename, "r"))) { perror(input_filename); -- 2.40.0