From: Jim Meyering Date: Thu, 14 Jan 1999 18:25:16 +0000 (+0000) Subject: Don't prototype usage as static. X-Git-Tag: TEXTUTILS-1_22h~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fec9172beaf67d1e16ae13b1f3ac44135cc8363;p=thirdparty%2Fcoreutils.git Don't prototype usage as static. --- diff --git a/src/cat.c b/src/cat.c index a278a951f9..8fe48e6484 100644 --- a/src/cat.c +++ b/src/cat.c @@ -72,7 +72,7 @@ static int newlines2 = 0; /* Count of non-fatal error conditions. */ static int exit_status = 0; -static void +void usage (int status) { if (status != 0) diff --git a/src/cksum.c b/src/cksum.c index 81d745d804..ad389827a4 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -260,7 +260,7 @@ cksum (char *file, int print_name) return 0; } -static void +void usage (int status) { if (status != 0) diff --git a/src/comm.c b/src/comm.c index ef27f81ddb..f2cf9953e0 100644 --- a/src/comm.c +++ b/src/comm.c @@ -57,7 +57,7 @@ static struct option const long_options[] = -static void +void usage (int status) { if (status != 0) diff --git a/src/csplit.c b/src/csplit.c index fe007eb5f2..17fca156e5 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -123,7 +123,7 @@ static void close_output_file PARAMS ((void)); static void create_output_file PARAMS ((void)); static void delete_all_files PARAMS ((void)); static void save_line_to_file PARAMS ((const struct cstring *line)); -static void usage PARAMS ((int status)); +void usage PARAMS ((int status)); /* The name this program was run with. */ char *program_name; @@ -1496,7 +1496,7 @@ main (int argc, char **argv) exit (EXIT_SUCCESS); } -static void +void usage (int status) { if (status != 0) diff --git a/src/cut.c b/src/cut.c index 801e8b8e34..e8047c95e7 100644 --- a/src/cut.c +++ b/src/cut.c @@ -187,7 +187,7 @@ static struct option const longopts[] = {0, 0, 0, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/expand.c b/src/expand.c index 84f589a937..ecb4590b25 100644 --- a/src/expand.c +++ b/src/expand.c @@ -98,7 +98,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/fmt.c b/src/fmt.c index f0f7108ee4..b944e36412 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -262,7 +262,7 @@ static int next_prefix_indent; paragraphs chosen by fmt_paragraph(). */ static int last_line_length; -static void +void usage (int status) { if (status != 0) diff --git a/src/fold.c b/src/fold.c index 14868b3435..e51bdde71e 100644 --- a/src/fold.c +++ b/src/fold.c @@ -55,7 +55,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/head.c b/src/head.c index 474ff8bc50..a698c2dd8c 100644 --- a/src/head.c +++ b/src/head.c @@ -76,7 +76,7 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) @@ -342,7 +342,6 @@ main (int argc, char **argv) } - while ((c = getopt_long (argc, argv, "c:n:qv", long_options, NULL)) != -1) { switch (c) diff --git a/src/join.c b/src/join.c index 72264f3788..30c27c5515 100644 --- a/src/join.c +++ b/src/join.c @@ -127,7 +127,7 @@ static struct line uni_blank; /* If nonzero, ignore case when comparing join fields. */ static int ignore_case; -static void +void usage (int status) { if (status != 0) diff --git a/src/md5sum.c b/src/md5sum.c index 5e364b5245..4803285833 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -93,7 +93,7 @@ static const struct option long_options[] = { NULL, 0, NULL, 0 } }; -static void +void usage (int status) { if (status != 0) diff --git a/src/nl.c b/src/nl.c index c0f3500182..cd4ce568da 100644 --- a/src/nl.c +++ b/src/nl.c @@ -165,7 +165,7 @@ static struct option const longopts[] = /* Print a usage message and quit. */ -static void +void usage (int status) { if (status != 0) diff --git a/src/od.c b/src/od.c index 71545ecf1a..1b4cf6539e 100644 --- a/src/od.c +++ b/src/od.c @@ -37,7 +37,6 @@ typedef long double LONG_DOUBLE; typedef double LONG_DOUBLE; #endif - #if HAVE_VALUES_H # include #endif @@ -264,7 +263,7 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/paste.c b/src/paste.c index 4136133c4d..21f7a0cb99 100644 --- a/src/paste.c +++ b/src/paste.c @@ -399,7 +399,7 @@ paste_serial (int nfiles, char **fnamptr) return errors; } -static void +void usage (int status) { if (status != 0) diff --git a/src/pr.c b/src/pr.c index ed524f93e5..c4c6790dce 100644 --- a/src/pr.c +++ b/src/pr.c @@ -29,7 +29,6 @@ Improve the printing of control prefixes. - Options: +FIRST_PAGE[:LAST_PAGE] @@ -270,7 +269,7 @@ static void pad_across_to PARAMS ((int position)); static void add_line_number PARAMS ((COLUMN *p)); static void getoptarg PARAMS ((char *arg, char switch_char, char *character, int *number)); -static void usage PARAMS ((int status)); +void usage PARAMS ((int status)); static void print_files PARAMS ((int number_of_files, char **av)); static void init_parameters PARAMS ((int number_of_files)); static void init_header PARAMS ((char *filename, int desc)); @@ -2438,7 +2437,7 @@ cleanup (void) /* Complain, print a usage message, and die. */ -static void +void usage (int status) { if (status != 0) diff --git a/src/ptx.c b/src/ptx.c index b086cb9252..215c47531b 100644 --- a/src/ptx.c +++ b/src/ptx.c @@ -176,7 +176,6 @@ int maximum_word_length; /* Maximum width of any reference used. */ int reference_max_width; - /* Ignore and Only word tables. */ WORD_TABLE ignore_table; /* table of words to ignore */ @@ -269,7 +268,6 @@ size_t number_of_occurs[1]; /* number of used slots in occurs_table */ #define ALLOC_NEW_OCCURS(language) \ BUMP_ALLOC (occurs_table[language], number_of_occurs[language], 9, OCCURS) - /* Communication among output routines. */ /* Indicate if special output processing is requested for each character. */ @@ -1810,7 +1808,6 @@ generate_all_output (void) int occurs_index; /* index of keyword entry being processed */ OCCURS *occurs_cursor; /* current keyword entry being processed */ - /* The following assignments are useful to provide default values in case line contexts or references are not used, in which case these variables would never be computed. */ @@ -1823,7 +1820,6 @@ generate_all_output (void) head.end = NULL; head_truncation = 0; - /* Loop over all keyword occurrences. */ occurs_cursor = occurs_table[0]; @@ -1867,7 +1863,7 @@ generate_all_output (void) | Print program identification and options, then exit. | `------------------------------------------------------*/ -static void +void usage (int status) { if (status != EXIT_SUCCESS) @@ -2064,8 +2060,8 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"), break; case 10: - XARGMATCH (&output_format, "--format", optarg, - format_args, format_vals, usage (1)); + output_format = XARGMATCH ("--format", optarg, + format_args, format_vals); } } diff --git a/src/sort.c b/src/sort.c index 6e76059df5..9636547ebb 100644 --- a/src/sort.c +++ b/src/sort.c @@ -269,7 +269,7 @@ static int have_read_stdin; /* Lists of key field comparisons to be tried. */ static struct keyfield keyhead; -static void +void usage (int status) { if (status != 0) diff --git a/src/split.c b/src/split.c index 288ee5ec92..938c5d1dfb 100644 --- a/src/split.c +++ b/src/split.c @@ -77,7 +77,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/sum.c b/src/sum.c index bb97e10a03..2a956c5041 100644 --- a/src/sum.c +++ b/src/sum.c @@ -51,7 +51,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/tac.c b/src/tac.c index b9841703ee..b547296c92 100644 --- a/src/tac.c +++ b/src/tac.c @@ -109,7 +109,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/tail.c b/src/tail.c index a8edb57698..90d8d49b4d 100644 --- a/src/tail.c +++ b/src/tail.c @@ -183,7 +183,7 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) @@ -1268,8 +1268,8 @@ parse_options (int argc, char **argv, if (optarg == NULL) follow_mode = DEFAULT_FOLLOW_MODE; else - XARGMATCH (&follow_mode, "--follow", optarg, - follow_mode_string, follow_mode_map, usage (1)); + follow_mode = XARGMATCH ("--follow", optarg, + follow_mode_string, follow_mode_map); break; case CHAR_MAX + 1: diff --git a/src/tr.c b/src/tr.c index 88d1700bbb..def9a3716c 100644 --- a/src/tr.c +++ b/src/tr.c @@ -315,7 +315,7 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/tsort.c b/src/tsort.c index 418532d1ba..270632ffea 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -77,7 +77,7 @@ static struct option const long_options[] = { NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) @@ -446,7 +446,6 @@ tsort (const char *file) } } - int main (int argc, char **argv) { diff --git a/src/unexpand.c b/src/unexpand.c index 5c4702494e..7768c14cbb 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -351,7 +351,7 @@ unexpand (void) } } -static void +void usage (int status) { if (status != 0) diff --git a/src/uniq.c b/src/uniq.c index d02790c2e2..9514fa10c5 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -90,7 +90,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0) diff --git a/src/wc.c b/src/wc.c index 9571fd9da0..8e20e91041 100644 --- a/src/wc.c +++ b/src/wc.c @@ -71,7 +71,7 @@ static struct option const longopts[] = {NULL, 0, NULL, 0} }; -static void +void usage (int status) { if (status != 0)