Commit 09003779 by Jakub Jelinek Committed by Jakub Jelinek

string.c (find_option): Change 3rd argument to const st_option *.

	* runtime/string.c (find_option): Change 3rd argument to
	const st_option *.
	* libgfortran.h (find_option): Likewise.
	* runtime/environ.c (rounding, precision, signal_choices): Constify.
	(init_choice, show_choice): Change 2nd argument to const choice *.
	* io/open.c (access_opt, action_opt, blank_opt, delim_opt, form_opt,
	position_opt, status_opt, pad_opt): Constify.
	* io/transfer.c (advance_opt): Likewise.
	* io/inquire.c (undefined): Likewise.
	* io/close.c (status_opt): Likewise.
	* io/format.c (posint_required, period_required, nonneg_required,
	unexpected_element, unexpected_end, bad_string, bad_hollerith,
	reversion_error): Likewise.
	* io/unix.c (yes, no, unknown): Change from const char *
	into const char [].

From-SVN: r104773
parent 1ebd8d9a
2005-09-29 Jakub Jelinek <jakub@redhat.com>
* runtime/string.c (find_option): Change 3rd argument to
const st_option *.
* libgfortran.h (find_option): Likewise.
* runtime/environ.c (rounding, precision, signal_choices): Constify.
(init_choice, show_choice): Change 2nd argument to const choice *.
* io/open.c (access_opt, action_opt, blank_opt, delim_opt, form_opt,
position_opt, status_opt, pad_opt): Constify.
* io/transfer.c (advance_opt): Likewise.
* io/inquire.c (undefined): Likewise.
* io/close.c (status_opt): Likewise.
* io/format.c (posint_required, period_required, nonneg_required,
unexpected_element, unexpected_end, bad_string, bad_hollerith,
reversion_error): Likewise.
* io/unix.c (yes, no, unknown): Change from const char *
into const char [].
2005-09-27 Steve Ellcey <sje@cup.hp.com> 2005-09-27 Steve Ellcey <sje@cup.hp.com>
PR target/23552 PR target/23552
......
...@@ -36,7 +36,7 @@ typedef enum ...@@ -36,7 +36,7 @@ typedef enum
{ CLOSE_DELETE, CLOSE_KEEP, CLOSE_UNSPECIFIED } { CLOSE_DELETE, CLOSE_KEEP, CLOSE_UNSPECIFIED }
close_status; close_status;
static st_option status_opt[] = { static const st_option status_opt[] = {
{"keep", CLOSE_KEEP}, {"keep", CLOSE_KEEP},
{"delete", CLOSE_DELETE}, {"delete", CLOSE_DELETE},
{NULL, 0} {NULL, 0}
......
...@@ -61,7 +61,7 @@ static fnode colon_node = { FMT_COLON, 0, NULL, NULL, {{ 0, 0, 0 }}, 0, ...@@ -61,7 +61,7 @@ static fnode colon_node = { FMT_COLON, 0, NULL, NULL, {{ 0, 0, 0 }}, 0,
/* Error messages */ /* Error messages */
static char posint_required[] = "Positive width required in format", static const char posint_required[] = "Positive width required in format",
period_required[] = "Period required in format", period_required[] = "Period required in format",
nonneg_required[] = "Nonnegative width required in format", nonneg_required[] = "Nonnegative width required in format",
unexpected_element[] = "Unexpected element in format", unexpected_element[] = "Unexpected element in format",
......
...@@ -35,7 +35,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -35,7 +35,7 @@ Boston, MA 02110-1301, USA. */
#include "io.h" #include "io.h"
static char undefined[] = "UNDEFINED"; static const char undefined[] = "UNDEFINED";
/* inquire_via_unit()-- Inquiry via unit number. The unit might not exist. */ /* inquire_via_unit()-- Inquiry via unit number. The unit might not exist. */
......
...@@ -36,13 +36,13 @@ Boston, MA 02110-1301, USA. */ ...@@ -36,13 +36,13 @@ Boston, MA 02110-1301, USA. */
#include "io.h" #include "io.h"
static st_option access_opt[] = { static const st_option access_opt[] = {
{"sequential", ACCESS_SEQUENTIAL}, {"sequential", ACCESS_SEQUENTIAL},
{"direct", ACCESS_DIRECT}, {"direct", ACCESS_DIRECT},
{NULL, 0} {NULL, 0}
}; };
static st_option action_opt[] = static const st_option action_opt[] =
{ {
{ "read", ACTION_READ}, { "read", ACTION_READ},
{ "write", ACTION_WRITE}, { "write", ACTION_WRITE},
...@@ -50,14 +50,14 @@ static st_option action_opt[] = ...@@ -50,14 +50,14 @@ static st_option action_opt[] =
{ NULL, 0} { NULL, 0}
}; };
static st_option blank_opt[] = static const st_option blank_opt[] =
{ {
{ "null", BLANK_NULL}, { "null", BLANK_NULL},
{ "zero", BLANK_ZERO}, { "zero", BLANK_ZERO},
{ NULL, 0} { NULL, 0}
}; };
static st_option delim_opt[] = static const st_option delim_opt[] =
{ {
{ "none", DELIM_NONE}, { "none", DELIM_NONE},
{ "apostrophe", DELIM_APOSTROPHE}, { "apostrophe", DELIM_APOSTROPHE},
...@@ -65,14 +65,14 @@ static st_option delim_opt[] = ...@@ -65,14 +65,14 @@ static st_option delim_opt[] =
{ NULL, 0} { NULL, 0}
}; };
static st_option form_opt[] = static const st_option form_opt[] =
{ {
{ "formatted", FORM_FORMATTED}, { "formatted", FORM_FORMATTED},
{ "unformatted", FORM_UNFORMATTED}, { "unformatted", FORM_UNFORMATTED},
{ NULL, 0} { NULL, 0}
}; };
static st_option position_opt[] = static const st_option position_opt[] =
{ {
{ "asis", POSITION_ASIS}, { "asis", POSITION_ASIS},
{ "rewind", POSITION_REWIND}, { "rewind", POSITION_REWIND},
...@@ -80,7 +80,7 @@ static st_option position_opt[] = ...@@ -80,7 +80,7 @@ static st_option position_opt[] =
{ NULL, 0} { NULL, 0}
}; };
static st_option status_opt[] = static const st_option status_opt[] =
{ {
{ "unknown", STATUS_UNKNOWN}, { "unknown", STATUS_UNKNOWN},
{ "old", STATUS_OLD}, { "old", STATUS_OLD},
...@@ -90,7 +90,7 @@ static st_option status_opt[] = ...@@ -90,7 +90,7 @@ static st_option status_opt[] =
{ NULL, 0} { NULL, 0}
}; };
static st_option pad_opt[] = static const st_option pad_opt[] =
{ {
{ "yes", PAD_YES}, { "yes", PAD_YES},
{ "no", PAD_NO}, { "no", PAD_NO},
......
...@@ -97,7 +97,7 @@ static char *line_buffer = NULL; ...@@ -97,7 +97,7 @@ static char *line_buffer = NULL;
static unit_advance advance_status; static unit_advance advance_status;
static st_option advance_opt[] = { static const st_option advance_opt[] = {
{"yes", ADVANCE_YES}, {"yes", ADVANCE_YES},
{"no", ADVANCE_NO}, {"no", ADVANCE_NO},
{NULL, 0} {NULL, 0}
......
...@@ -1197,7 +1197,7 @@ file_exists (void) ...@@ -1197,7 +1197,7 @@ file_exists (void)
static const char *yes = "YES", *no = "NO", *unknown = "UNKNOWN"; static const char yes[] = "YES", no[] = "NO", unknown[] = "UNKNOWN";
/* inquire_sequential()-- Given a fortran string, determine if the /* inquire_sequential()-- Given a fortran string, determine if the
* file is suitable for sequential access. Returns a C-style * file is suitable for sequential access. Returns a C-style
......
...@@ -478,7 +478,7 @@ internal_proto(show_variables); ...@@ -478,7 +478,7 @@ internal_proto(show_variables);
/* string.c */ /* string.c */
extern int find_option (const char *, int, st_option *, const char *); extern int find_option (const char *, int, const st_option *, const char *);
internal_proto(find_option); internal_proto(find_option);
extern int fstrlen (const char *, int); extern int fstrlen (const char *, int);
......
...@@ -356,7 +356,7 @@ choice; ...@@ -356,7 +356,7 @@ choice;
enum enum
{ FP_ROUND_NEAREST, FP_ROUND_UP, FP_ROUND_DOWN, FP_ROUND_ZERO }; { FP_ROUND_NEAREST, FP_ROUND_UP, FP_ROUND_DOWN, FP_ROUND_ZERO };
static choice rounding[] = { static const choice rounding[] = {
{"NEAREST", FP_ROUND_NEAREST}, {"NEAREST", FP_ROUND_NEAREST},
{"UP", FP_ROUND_UP}, {"UP", FP_ROUND_UP},
{"DOWN", FP_ROUND_DOWN}, {"DOWN", FP_ROUND_DOWN},
...@@ -364,7 +364,7 @@ static choice rounding[] = { ...@@ -364,7 +364,7 @@ static choice rounding[] = {
{NULL, 0} {NULL, 0}
}; };
static choice precision[] = static const choice precision[] =
{ {
{ "24", 1}, { "24", 1},
{ "53", 2}, { "53", 2},
...@@ -372,7 +372,7 @@ static choice precision[] = ...@@ -372,7 +372,7 @@ static choice precision[] =
{ NULL, 0} { NULL, 0}
}; };
static choice signal_choices[] = static const choice signal_choices[] =
{ {
{ "IGNORE", 1}, { "IGNORE", 1},
{ "ABORT", 0}, { "ABORT", 0},
...@@ -381,7 +381,7 @@ static choice signal_choices[] = ...@@ -381,7 +381,7 @@ static choice signal_choices[] =
static void static void
init_choice (variable * v, choice * c) init_choice (variable * v, const choice * c)
{ {
char *p; char *p;
...@@ -408,7 +408,7 @@ init_choice (variable * v, choice * c) ...@@ -408,7 +408,7 @@ init_choice (variable * v, choice * c)
static void static void
show_choice (variable * v, choice * c) show_choice (variable * v, const choice * c)
{ {
st_printf ("%s ", var_source (v)); st_printf ("%s ", var_source (v));
......
...@@ -104,7 +104,7 @@ cf_strcpy (char *dest, int dest_len, const char *src) ...@@ -104,7 +104,7 @@ cf_strcpy (char *dest, int dest_len, const char *src)
if no default is provided. */ if no default is provided. */
int int
find_option (const char *s1, int s1_len, st_option * opts, find_option (const char *s1, int s1_len, const st_option * opts,
const char *error_message) const char *error_message)
{ {
for (; opts->name; opts++) for (; opts->name; opts++)
......
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