aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaveh Ghazi <ghazi@caip.rutgers.edu>2001-12-23 16:07:16 +0000
committerKaveh Ghazi <ghazi@caip.rutgers.edu>2001-12-23 16:07:16 +0000
commitbfdc6f01ac25ec4054c6c07648b5df3ca8d0f2bf (patch)
tree3a92e39c3950a0111e36bf45eea110d72fbf1e8a
parent70118c77bab58617ffbf3084fbf25d4b11ad0497 (diff)
* arc.c (arc_hard_regno_mode_ok): Const-ify.
* arc.h (arc_hard_regno_mode_ok): Likewise. * i386.c (x86_64_reg_class_name): Make static. * m68k.c (regno_reg_class): Const-ify. * m68k.h (regno_reg_class): Likewise. * mcore.c (reg_class_from_letter): Likewise. * mcore.h (reg_class_from_letter): Likewise. * sh.c (reg_class_from_letter, ashiftrt_insns, shift_insns, ext_shift_insns, ext_shift_amounts): Likewise. * sh.h (reg_class_from_letter): Likewise. * sparc.c (hard_regno_mode_classes, hard_32bit_mode_classes, hard_64bit_mode_classes): Likewise. * sparc.h (hard_regno_mode_classes): Likewise. * gcc.c (modify_target): Make static. * gengenrtl.c (defs, formats): Likewise. * reload1.c (elim_table_1, init_elim_table): Const-ify. * tradcpp.c (directive, directive_table, handle_directive, skip_if_group, run_directive): Likewise. cp: * decl2.c (lang_f_options): Const-ify. f: * com.c (ffecom_gfrt_volatile_, ffecom_gfrt_complex_, ffecom_gfrt_const_, ffecom_gfrt_type_): Const-ify. java: * Make-lang.in (keyword.h): Pass -C to gperf to const-ify the static arrays that are output. * jvspec.c (jvgenmain_spec): Make static. * keyword.gperf (struct java_keyword, java_keyword): Const-ify. * keyword.h: Regenerate. * lang.c (string_option, process_option_with_no, lang_f_options, lang_W_options): Const-ify. * lex.c (java_lex): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@48290 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog22
-rw-r--r--gcc/config/arc/arc.c2
-rw-r--r--gcc/config/arc/arc.h2
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/m68k/m68k.c2
-rw-r--r--gcc/config/m68k/m68k.h2
-rw-r--r--gcc/config/mcore/mcore.c2
-rw-r--r--gcc/config/mcore/mcore.h2
-rw-r--r--gcc/config/sh/sh.c10
-rw-r--r--gcc/config/sh/sh.h2
-rw-r--r--gcc/config/sparc/sparc.c6
-rw-r--r--gcc/config/sparc/sparc.h2
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/f/ChangeLog5
-rw-r--r--gcc/f/com.c8
-rw-r--r--gcc/gcc.c2
-rw-r--r--gcc/gengenrtl.c4
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/Make-lang.in2
-rw-r--r--gcc/java/jvspec.c2
-rw-r--r--gcc/java/keyword.gperf4
-rw-r--r--gcc/java/keyword.h29
-rw-r--r--gcc/java/lang.c18
-rw-r--r--gcc/java/lex.c2
-rw-r--r--gcc/reload1.c8
-rw-r--r--gcc/tradcpp.c16
27 files changed, 111 insertions, 62 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3db09bb7839..cf93c45b7b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,25 @@
+2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arc.c (arc_hard_regno_mode_ok): Const-ify.
+ * arc.h (arc_hard_regno_mode_ok): Likewise.
+ * i386.c (x86_64_reg_class_name): Make static.
+ * m68k.c (regno_reg_class): Const-ify.
+ * m68k.h (regno_reg_class): Likewise.
+ * mcore.c (reg_class_from_letter): Likewise.
+ * mcore.h (reg_class_from_letter): Likewise.
+ * sh.c (reg_class_from_letter, ashiftrt_insns, shift_insns,
+ ext_shift_insns, ext_shift_amounts): Likewise.
+ * sh.h (reg_class_from_letter): Likewise.
+ * sparc.c (hard_regno_mode_classes, hard_32bit_mode_classes,
+ hard_64bit_mode_classes): Likewise.
+ * sparc.h (hard_regno_mode_classes): Likewise.
+
+ * gcc.c (modify_target): Make static.
+ * gengenrtl.c (defs, formats): Likewise.
+ * reload1.c (elim_table_1, init_elim_table): Const-ify.
+ * tradcpp.c (directive, directive_table, handle_directive,
+ skip_if_group, run_directive): Likewise.
+
2001-12-23 Richard Henderson <rth@redhat.com>
* calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 62ed01097bf..6a31b6cef89 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -251,7 +251,7 @@ enum arc_mode_class {
/* Value is 1 if register/mode pair is acceptable on arc. */
-unsigned int arc_hard_regno_mode_ok[] = {
+const unsigned int arc_hard_regno_mode_ok[] = {
T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES,
T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES,
T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, T_MODES, D_MODES,
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index f6212d16895..5188d09e81a 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -397,7 +397,7 @@ if (GET_MODE_CLASS (MODE) == MODE_INT \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
-extern unsigned int arc_hard_regno_mode_ok[];
+extern const unsigned int arc_hard_regno_mode_ok[];
extern unsigned int arc_mode_class[];
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
((arc_hard_regno_mode_ok[REGNO] & arc_mode_class[MODE]) != 0)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8bb7536ad98..b65cd1c3014 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -746,7 +746,7 @@ enum x86_64_reg_class
X86_64_X87UP_CLASS,
X86_64_MEMORY_CLASS
};
-const char * const x86_64_reg_class_name[] =
+static const char * const x86_64_reg_class_name[] =
{"no", "integer", "integerSI", "sse", "sseSF", "sseDF", "sseup", "x87", "x87up", "no"};
#define MAX_CLASSES 4
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 9e6880b9934..42c4f7cc287 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -47,7 +47,7 @@ Boston, MA 02111-1307, USA. */
/* Index into this array by (register number >> 3) to find the
smallest class which contains that register. */
-enum reg_class regno_reg_class[]
+const enum reg_class regno_reg_class[]
= { DATA_REGS, ADDR_REGS, FP_REGS,
LO_FPA_REGS, LO_FPA_REGS, FPA_REGS, FPA_REGS };
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index 2d422a07c17..76b10b02761 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -749,7 +749,7 @@ enum reg_class { NO_REGS, LO_FPA_REGS, FPA_REGS, FP_REGS,
reg number REGNO. This could be a conditional expression
or could index an array. */
-extern enum reg_class regno_reg_class[];
+extern const enum reg_class regno_reg_class[];
#define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)>>3])
#endif /* SUPPORT_SUN_FPA */
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 2b47e24e82d..2b6d1e8cedf 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -73,7 +73,7 @@ int regno_reg_class[FIRST_PSEUDO_REGISTER] =
/* Provide reg_class from a letter such as appears in the machine
description. */
-enum reg_class reg_class_from_letter[] =
+const enum reg_class reg_class_from_letter[] =
{
/* a */ LRW_REGS, /* b */ ONLYR1_REGS, /* c */ C_REGS, /* d */ NO_REGS,
/* e */ NO_REGS, /* f */ NO_REGS, /* g */ NO_REGS, /* h */ NO_REGS,
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index 77454611056..420124fdccb 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -544,7 +544,7 @@ extern int regno_reg_class[FIRST_PSEUDO_REGISTER];
/* Get reg_class from a letter such as appears in the machine
description. */
-extern enum reg_class reg_class_from_letter[];
+extern const enum reg_class reg_class_from_letter[];
#define REG_CLASS_FROM_LETTER(C) \
( ISLOWER (C) ? reg_class_from_letter[(C) - 'a'] : NO_REGS )
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index d08100d257e..675109a2278 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -122,7 +122,7 @@ char fp_reg_names[][5] =
/* Provide reg_class from a letter such as appears in the machine
description. */
-enum reg_class reg_class_from_letter[] =
+const enum reg_class reg_class_from_letter[] =
{
/* a */ ALL_REGS, /* b */ NO_REGS, /* c */ FPSCR_REGS, /* d */ DF_REGS,
/* e */ NO_REGS, /* f */ FP_REGS, /* g */ NO_REGS, /* h */ NO_REGS,
@@ -957,11 +957,11 @@ output_file_start (file)
}
/* Actual number of instructions used to make a shift by N. */
-static char ashiftrt_insns[] =
+static const char ashiftrt_insns[] =
{ 0,1,2,3,4,5,8,8,8,8,8,8,8,8,8,8,2,3,4,5,8,8,8,8,8,8,8,8,8,8,8,2};
/* Left shift and logical right shift are the same. */
-static char shift_insns[] =
+static const char shift_insns[] =
{ 0,1,1,2,2,3,3,4,1,2,2,3,3,4,3,3,1,2,2,3,3,4,3,3,2,3,3,4,4,4,3,3};
/* Individual shift amounts needed to get the above length sequences.
@@ -982,10 +982,10 @@ static short shift_amounts[32][5] = {
might be clobbered. This is typically used when combined with some
kind of sign or zero extension. */
-static char ext_shift_insns[] =
+static const char ext_shift_insns[] =
{ 0,1,1,2,2,3,2,2,1,2,2,3,3,3,2,2,1,2,2,3,3,4,3,3,2,3,3,4,4,4,3,3};
-static short ext_shift_amounts[32][4] = {
+static const short ext_shift_amounts[32][4] = {
{0}, {1}, {2}, {2, 1},
{2, 2}, {2, 1, 2}, {8, -2}, {8, -1},
{8}, {8, 1}, {8, 2}, {8, 1, 2},
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index aa94109be5f..979e83b9ce7 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -829,7 +829,7 @@ extern int regno_reg_class[FIRST_PSEUDO_REGISTER];
/* Get reg_class from a letter such as appears in the machine
description. */
-extern enum reg_class reg_class_from_letter[];
+extern const enum reg_class reg_class_from_letter[];
#define REG_CLASS_FROM_LETTER(C) \
( ISLOWER (C) ? reg_class_from_letter[(C)-'a'] : NO_REGS )
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 26577c2068a..8914a8b3314 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -3070,9 +3070,9 @@ enum sparc_mode_class {
they cross fixed registers). */
/* This points to either the 32 bit or the 64 bit version. */
-int *hard_regno_mode_classes;
+const int *hard_regno_mode_classes;
-static int hard_32bit_mode_classes[] = {
+static const int hard_32bit_mode_classes[] = {
S_MODES, S_MODES, T_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
T_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES, D_MODES, S_MODES,
T_MODES, S_MODES, T_MODES, S_MODES, T_MODES, S_MODES, D_MODES, S_MODES,
@@ -3097,7 +3097,7 @@ static int hard_32bit_mode_classes[] = {
CC_MODES
};
-static int hard_64bit_mode_classes[] = {
+static const int hard_64bit_mode_classes[] = {
D_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES,
O_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES,
T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES, T_MODES, D_MODES,
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 0eb98cc0ebd..e18fb14bfae 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1091,7 +1091,7 @@ while (0)
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
See sparc.c for how we initialize this. */
-extern int *hard_regno_mode_classes;
+extern const int *hard_regno_mode_classes;
extern int sparc_mode_class[];
/* ??? Because of the funny way we pass parameters we should allow certain
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 548c5820ad5..6614ddb74fd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * decl2.c (lang_f_options): Const-ify.
+
2001-12-20 Joseph S. Myers <jsm28@cam.ac.uk>
* config-lang.in (diff_excludes): Remove.
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 14b045ea76b..cde4e698655 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -406,7 +406,7 @@ int flag_enforce_eh_specs = 1;
if `-fSTRING' is seen as an option.
(If `-fno-STRING' is seen as an option, the opposite value is stored.) */
-static struct { const char *const string; int *variable; int on_value;}
+static const struct { const char *const string; int *const variable; const int on_value;}
lang_f_options[] =
{
/* C/C++ options. */
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 313074a3dca..dce48534fd9 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,8 @@
+Sun Dec 23 10:45:09 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * com.c (ffecom_gfrt_volatile_, ffecom_gfrt_complex_,
+ ffecom_gfrt_const_, ffecom_gfrt_type_): Const-ify.
+
Sat Dec 22 16:01:51 2001 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bld.c (ffebld_arity_op_): Declare array size explicitly.
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 982b3f8bcce..823f18dff11 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -437,7 +437,7 @@ static const char *const ffecom_gfrt_name_[FFECOM_gfrt]
/* Whether the function returns. */
-static bool ffecom_gfrt_volatile_[FFECOM_gfrt]
+static const bool ffecom_gfrt_volatile_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) VOLATILE,
@@ -447,7 +447,7 @@ static bool ffecom_gfrt_volatile_[FFECOM_gfrt]
/* Whether the function returns type complex. */
-static bool ffecom_gfrt_complex_[FFECOM_gfrt]
+static const bool ffecom_gfrt_complex_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) COMPLEX,
@@ -458,7 +458,7 @@ static bool ffecom_gfrt_complex_[FFECOM_gfrt]
/* Whether the function is const
(i.e., has no side effects and only depends on its arguments). */
-static bool ffecom_gfrt_const_[FFECOM_gfrt]
+static const bool ffecom_gfrt_const_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) CONST,
@@ -468,7 +468,7 @@ static bool ffecom_gfrt_const_[FFECOM_gfrt]
/* Type code for the function return value. */
-static ffecomRttype_ ffecom_gfrt_type_[FFECOM_gfrt]
+static const ffecomRttype_ ffecom_gfrt_type_[FFECOM_gfrt]
=
{
#define DEFGFRT(CODE,NAME,TYPE,ARGS,VOLATILE,COMPLEX,CONST) TYPE,
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 2dc7b72af36..3d22c8c408b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -234,7 +234,7 @@ static const char *cross_compile = "0";
switch. The only case we support now is simply appending or deleting a
string to or from the end of the first part of the configuration name. */
-const struct modify_target
+static const struct modify_target
{
const char *const sw;
const enum add_del {ADD, DELETE} add_del;
diff --git a/gcc/gengenrtl.c b/gcc/gengenrtl.c
index 0d40025f76e..157baf179e0 100644
--- a/gcc/gengenrtl.c
+++ b/gcc/gengenrtl.c
@@ -100,12 +100,12 @@ struct rtx_definition
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { STRINGX(ENUM), NAME, FORMAT },
-const struct rtx_definition defs[] =
+static const struct rtx_definition defs[] =
{
#include "rtl.def" /* rtl expressions are documented here */
};
-const char *formats[NUM_RTX_CODE];
+static const char *formats[NUM_RTX_CODE];
static const char *type_from_format PARAMS ((int));
static const char *accessor_from_format PARAMS ((int));
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a1773a33a2a..71b1a100a7c 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+2001-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Make-lang.in (keyword.h): Pass -C to gperf to const-ify
+ the static arrays that are output.
+ * jvspec.c (jvgenmain_spec): Make static.
+ * keyword.gperf (struct java_keyword, java_keyword): Const-ify.
+ * keyword.h: Regenerate.
+ * lang.c (string_option, process_option_with_no, lang_f_options,
+ lang_W_options): Const-ify.
+ * lex.c (java_lex): Likewise.
+
2001-12-21 Richard Henderson <rth@redhat.com>
* boehm.c (PROCEDURE_OBJECT_DESCRIPTOR): Merge into ..
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index 1a8f595a822..194bdfa9116 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -90,7 +90,7 @@ $(srcdir)/java/parse-scan.c: $(srcdir)/java/parse-scan.y
$(srcdir)/java/keyword.h: $(srcdir)/java/keyword.gperf
(cd $(srcdir)/java || exit 1; \
- gperf -L C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$$ \
+ gperf -L C -C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$$ \
keyword.gperf > k$$$$.h || { \
echo "Please update gperf from ftp://ftp.gnu.org/pub/gnu/gperf/" >&2; \
rm -f k$$$$.h; \
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 1fd4f4cc87a..dba2ee6929f 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -53,7 +53,7 @@ int lang_specific_extra_outfiles = 0;
/* True if we should add -shared-libgcc to the command-line. */
int shared_libgcc = 1;
-const char jvgenmain_spec[] =
+static const char jvgenmain_spec[] =
"jvgenmain %{D*} %b %{!pipe:%u.i} |\n\
cc1 %{!pipe:%U.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
diff --git a/gcc/java/keyword.gperf b/gcc/java/keyword.gperf
index 2d28812bc2d..4256ca7fe3c 100644
--- a/gcc/java/keyword.gperf
+++ b/gcc/java/keyword.gperf
@@ -25,7 +25,7 @@ of Sun Microsystems, Inc. in the United States and other countries.
The Free Software Foundation is independent of Sun Microsystems, Inc. */
%}
-struct java_keyword { const char *const name; int token; };
+struct java_keyword { const char *const name; const int token; };
#ifdef __GNUC__
__inline
#endif
@@ -33,7 +33,7 @@ static unsigned int hash PARAMS ((const char *, unsigned int));
#ifdef __GNUC__
__inline
#endif
-struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
+const struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
%%
abstract, ABSTRACT_TK
default, DEFAULT_TK
diff --git a/gcc/java/keyword.h b/gcc/java/keyword.h
index 7e8832f4ec7..a2bc12dc534 100644
--- a/gcc/java/keyword.h
+++ b/gcc/java/keyword.h
@@ -1,5 +1,5 @@
-/* C code produced by gperf version 2.7 */
-/* Command-line: gperf -L C -F , 0 -p -t -j1 -i 1 -g -o -N java_keyword -k1,4,$ keyword.gperf */
+/* C code produced by gperf version 2.7.2 */
+/* Command-line: gperf -L C -C -F ', 0' -p -t -j1 -i 1 -g -o -N java_keyword -k'1,4,$' keyword.gperf */
/* Keyword definition for the GNU compiler for the Java(TM) language.
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
@@ -25,7 +25,7 @@ Java and all Java-based marks are trademarks or registered trademarks
of Sun Microsystems, Inc. in the United States and other countries.
The Free Software Foundation is independent of Sun Microsystems, Inc. */
-struct java_keyword { const char *const name; int token; };
+struct java_keyword { const char *const name; const int token; };
#ifdef __GNUC__
__inline
#endif
@@ -33,7 +33,7 @@ static unsigned int hash PARAMS ((const char *, unsigned int));
#ifdef __GNUC__
__inline
#endif
-struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
+const struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
#define TOTAL_KEYWORDS 51
#define MIN_WORD_LENGTH 2
@@ -44,13 +44,17 @@ struct java_keyword *java_keyword PARAMS ((const char *, unsigned int));
#ifdef __GNUC__
__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
#endif
static unsigned int
hash (str, len)
register const char *str;
register unsigned int len;
{
- static unsigned char asso_values[] =
+ static const unsigned char asso_values[] =
{
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
@@ -98,14 +102,15 @@ hash (str, len)
#ifdef __GNUC__
__inline
#endif
-struct java_keyword *
+const struct java_keyword *
java_keyword (str, len)
register const char *str;
register unsigned int len;
{
- static struct java_keyword wordlist[] =
+ static const struct java_keyword wordlist[] =
{
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0},
{"else", ELSE_TK},
{"true", TRUE_TK},
{"case", CASE_TK},
@@ -163,12 +168,14 @@ java_keyword (str, len)
{"instanceof", INSTANCEOF_TK},
{"", 0},
{"throw", THROW_TK},
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0},
{"native", NATIVE_TK},
{"", 0}, {"", 0}, {"", 0}, {"", 0},
{"import", IMPORT_TK},
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
- {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
+ {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0}, {"", 0},
{"goto", GOTO_TK}
};
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 11e036ca38a..0486abd08f0 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -43,9 +43,9 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
struct string_option
{
- const char *string;
- int *variable;
- int on_value;
+ const char *const string;
+ int *const variable;
+ const int on_value;
};
static const char *java_init PARAMS ((const char *));
@@ -56,8 +56,8 @@ static void put_decl_string PARAMS ((const char *, int));
static void put_decl_node PARAMS ((tree));
static void java_dummy_print PARAMS ((diagnostic_context *, const char *));
static void lang_print_error PARAMS ((diagnostic_context *, const char *));
-static int process_option_with_no PARAMS ((char *,
- struct string_option *,
+static int process_option_with_no PARAMS ((const char *,
+ const struct string_option *,
int));
#ifndef TARGET_OBJECT_SUFFIX
@@ -166,7 +166,7 @@ static int version_flag = 0;
if `-fSTRING' is seen as an option.
(If `-fno-STRING' is seen as an option, the opposite value is stored.) */
-static struct string_option
+static const struct string_option
lang_f_options[] =
{
{"emit-class-file", &flag_emit_class_files, 1},
@@ -182,7 +182,7 @@ lang_f_options[] =
{"indirect-dispatch", &flag_indirect_dispatch, 1}
};
-static struct string_option
+static const struct string_option
lang_W_options[] =
{
{ "redundant-modifiers", &flag_redundant, 1 },
@@ -222,8 +222,8 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
Return 1 if option found, 0 otherwise. */
static int
process_option_with_no (p, table, table_size)
- char *p;
- struct string_option *table;
+ const char *p;
+ const struct string_option *table;
int table_size;
{
int j;
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index adc5951db4b..2fc64dc1882 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -1567,7 +1567,7 @@ java_lex (java_lval)
this is an identifier (possibly not respecting formation rule). */
if (all_ascii)
{
- struct java_keyword *kw;
+ const struct java_keyword *kw;
if ((kw=java_keyword (string, ascii_index)))
{
JAVA_LEX_KW (string);
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 0f41718efe4..451a0906052 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -323,10 +323,10 @@ static struct elim_table *reg_eliminate = 0;
/* This is an intermediate structure to initialize the table. It has
exactly the members provided by ELIMINABLE_REGS. */
-static struct elim_table_1
+static const struct elim_table_1
{
- int from;
- int to;
+ const int from;
+ const int to;
} reg_eliminate_1[] =
/* If a set of eliminable registers was specified, define the table from it.
@@ -3486,7 +3486,7 @@ init_elim_table ()
{
struct elim_table *ep;
#ifdef ELIMINABLE_REGS
- struct elim_table_1 *ep1;
+ const struct elim_table_1 *ep1;
#endif
if (!reg_eliminate)
diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c
index c7af4c72d4f..11c5fd3c5c0 100644
--- a/gcc/tradcpp.c
+++ b/gcc/tradcpp.c
@@ -310,11 +310,11 @@ HASHNODE *hashtab[HASHSIZE];
/* `struct directive' defines one #-directive, including how to handle it. */
struct directive {
- int length; /* Length of name */
- void (*func) PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
+ const int length; /* Length of name */
+ void (*const func) PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *));
/* Function to handle directive */
- const char *name; /* Name of directive */
- enum node_type type; /* Code which describes which directive. */
+ const char *const name; /* Name of directive */
+ const enum node_type type; /* Code which describes which directive. */
};
/* Last arg to output_line_command. */
@@ -446,7 +446,7 @@ int main PARAMS ((int, char **));
/* Here is the actual list of #-directives, most-often-used first. */
-struct directive directive_table[] = {
+static const struct directive directive_table[] = {
{ 6, do_define, "define", T_DEFINE },
{ 7, do_include, "include", T_INCLUDE },
{ 5, do_endif, "endif", T_ENDIF },
@@ -1904,7 +1904,7 @@ handle_directive (ip, op)
FILE_BUF *ip, *op;
{
U_CHAR *bp, *cp;
- struct directive *kt;
+ const struct directive *kt;
int ident_length;
U_CHAR *resume_p;
@@ -3684,7 +3684,7 @@ skip_if_group (ip, any)
{
U_CHAR *bp = ip->bufp, *cp;
U_CHAR *endb = ip->buf + ip->length;
- struct directive *kt;
+ const struct directive *kt;
IF_STACK_FRAME *save_if_stack = if_stack; /* don't pop past here */
U_CHAR *beg_of_line = bp;
@@ -5117,7 +5117,7 @@ run_directive (str, len, type)
size_t len;
enum node_type type;
{
- struct directive *kt;
+ const struct directive *kt;
FILE_BUF *ip = &instack[++indepth];
ip->fname = "*command line*";