Commit 03fc1620 by Jim Wilson

(init_spec): Delete parameter. Always initialize extra_specs.

(process_command, main): Change all callers.

From-SVN: r13737
parent 987e845a
...@@ -231,7 +231,7 @@ extern char *version_string; ...@@ -231,7 +231,7 @@ extern char *version_string;
/* Forward declaration for prototypes. */ /* Forward declaration for prototypes. */
struct path_prefix; struct path_prefix;
static void init_spec PROTO((int)); static void init_spec PROTO(());
static void set_spec PROTO((char *, char *)); static void set_spec PROTO((char *, char *));
static struct compiler *lookup_compiler PROTO((char *, int, char *)); static struct compiler *lookup_compiler PROTO((char *, int, char *));
static char *build_search_list PROTO((struct path_prefix *, char *, int)); static char *build_search_list PROTO((struct path_prefix *, char *, int));
...@@ -1227,8 +1227,7 @@ static struct spec_list *specs = (struct spec_list *)0; ...@@ -1227,8 +1227,7 @@ static struct spec_list *specs = (struct spec_list *)0;
/* Initialize the specs lookup routines. */ /* Initialize the specs lookup routines. */
static void static void
init_spec (use_extra_p) init_spec ()
int use_extra_p;
{ {
struct spec_list *next = (struct spec_list *)0; struct spec_list *next = (struct spec_list *)0;
struct spec_list *sl = (struct spec_list *)0; struct spec_list *sl = (struct spec_list *)0;
...@@ -1238,15 +1237,14 @@ init_spec (use_extra_p) ...@@ -1238,15 +1237,14 @@ init_spec (use_extra_p)
return; /* already initialized */ return; /* already initialized */
#ifdef EXTRA_SPECS #ifdef EXTRA_SPECS
if (use_extra_p) for (i = (sizeof (extra_specs) / sizeof (extra_specs[0])) - 1; i >= 0; i--)
for (i = (sizeof (extra_specs) / sizeof (extra_specs[0])) - 1; i >= 0; i--) {
{ sl = &extra_specs[i];
sl = &extra_specs[i]; sl->next = next;
sl->next = next; sl->name_len = strlen (sl->name);
sl->name_len = strlen (sl->name); sl->ptr_spec = &sl->ptr;
sl->ptr_spec = &sl->ptr; next = sl;
next = sl; }
}
#endif #endif
for (i = (sizeof (static_specs) / sizeof (static_specs[0])) - 1; i >= 0; i--) for (i = (sizeof (static_specs) / sizeof (static_specs[0])) - 1; i >= 0; i--)
...@@ -2345,7 +2343,7 @@ process_command (argc, argv) ...@@ -2345,7 +2343,7 @@ process_command (argc, argv)
if (! strcmp (argv[i], "-dumpspecs")) if (! strcmp (argv[i], "-dumpspecs"))
{ {
struct spec_list *sl; struct spec_list *sl;
init_spec (TRUE); init_spec ();
for (sl = specs; sl; sl = sl->next) for (sl = specs; sl; sl = sl->next)
printf ("*%s:\n%s\n\n", sl->name, *(sl->ptr_spec)); printf ("*%s:\n%s\n\n", sl->name, *(sl->ptr_spec));
exit (0); exit (0);
...@@ -4240,15 +4238,11 @@ main (argc, argv) ...@@ -4240,15 +4238,11 @@ main (argc, argv)
spec_version, dir_separator_str, NULL_PTR); spec_version, dir_separator_str, NULL_PTR);
just_machine_suffix = concat (spec_machine, dir_separator_str, NULL_PTR); just_machine_suffix = concat (spec_machine, dir_separator_str, NULL_PTR);
init_spec ();
specs_file = find_a_file (&startfile_prefixes, "specs", R_OK); specs_file = find_a_file (&startfile_prefixes, "specs", R_OK);
/* Read the specs file unless it is a default one. */ /* Read the specs file unless it is a default one. */
if (specs_file != 0 && strcmp (specs_file, "specs")) if (specs_file != 0 && strcmp (specs_file, "specs"))
{ read_specs (specs_file);
init_spec (TRUE);
read_specs (specs_file);
}
else
init_spec (FALSE);
/* Process any user specified specs in the order given on the command /* Process any user specified specs in the order given on the command
line. */ line. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment