]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arc.c (arc_hard_regno_mode_ok): Const-ify.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 23 Dec 2001 16:07:16 +0000 (16:07 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 23 Dec 2001 16:07:16 +0000 (16:07 +0000)
* 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.

From-SVN: r48290

27 files changed:
gcc/ChangeLog
gcc/config/arc/arc.c
gcc/config/arc/arc.h
gcc/config/i386/i386.c
gcc/config/m68k/m68k.c
gcc/config/m68k/m68k.h
gcc/config/mcore/mcore.c
gcc/config/mcore/mcore.h
gcc/config/sh/sh.c
gcc/config/sh/sh.h
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/f/ChangeLog
gcc/f/com.c
gcc/gcc.c
gcc/gengenrtl.c
gcc/java/ChangeLog
gcc/java/Make-lang.in
gcc/java/jvspec.c
gcc/java/keyword.gperf
gcc/java/keyword.h
gcc/java/lang.c
gcc/java/lex.c
gcc/reload1.c
gcc/tradcpp.c

index 3db09bb78395dc71d5df89f28384197e074de266..cf93c45b7b81df741ed15c2ef6c3fa2b67890c27 100644 (file)
@@ -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
index 62ed01097bf9eb6b79d34e5e48e10055ecc62da6..6a31b6cef8975245009044e81fb0175eeb4ae9d8 100644 (file)
@@ -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,
index f6212d16895605a73f8d8c9371fcc3b5c7dcda4c..5188d09e81a2f7cd060d8c6d699fd4ad08678054 100644 (file)
@@ -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)
index 8bb7536ad9869396125eb89d1faefe316230a06d..b65cd1c3014347234fdeb207ebdd8f7b981d5459 100644 (file)
@@ -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
index 9e6880b9934222a5fa626d53bfeef03670580d7d..42c4f7cc287823bf7ce7648cfa9facbbcb8e5400 100644 (file)
@@ -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 };
 
index 2d422a07c173e236dcb1f3141bff332dd5292ef7..76b10b0276148a70f9d8e76d073d4637e6b77066 100644 (file)
@@ -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 */
index 2b47e24e82ddf827b3521238610dbd2970cc6ce5..2b6d1e8cedf2c0dfbe1dde5908cafd1d91c7e9a0 100644 (file)
@@ -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,
index 774546110561c38277ccaed0e4552ddcd543edbc..420124fdccb5b6589f97137279a1e38815e69619 100644 (file)
@@ -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 )
index d08100d257eea5b6ec1b4c42f228b59aec3cb009..675109a2278d02431c7e349e717d6fc98d5977ef 100644 (file)
@@ -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)
 }
 \f
 /* 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},
index aa94109be5fa60406a3feb13a08775dd9ed59c61..979e83b9ce72c303eb62ca8cf98c3292a3b36966 100644 (file)
@@ -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 )
index 26577c2068abff8890a0c2f2fef9a468d9f7e6bb..8914a8b331494ceb66baaea895fda1fa80dcc89f 100644 (file)
@@ -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,
index 0eb98cc0ebdfe747a0f2cab5281f23b7ea8c5948..e18fb14bfae499d55a6631bfebe464ee2e3d42a3 100644 (file)
@@ -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
index 548c5820ad579f2c5d9862082bfdbaa3ffeb69b0..6614ddb74fd1e1af75c881712f2d6bd815b78d4f 100644 (file)
@@ -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.
index 14b045ea76b045a0d65c046e102cbf76bf5a4b96..cde4e698655eccf21c6f4ad82c7af9a2ca738e92 100644 (file)
@@ -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.  */
index 313074a3dca83c65edfff7e47e0b64739bc64ee0..dce48534fd9f8047d8ee5581fd8abffca0cc37f5 100644 (file)
@@ -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.
index 982b3f8bcce16030e111bdc2f83e752ba98bb3b4..823f18dff113c6ea47121075a8a139439c443989 100644 (file)
@@ -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,
index 2dc7b72af36c560face18491b6095223f2c062aa..3d22c8c408b0e57771d0eb1651a13cd93f570a45 100644 (file)
--- 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;
index 0d40025f76eeb36e91d9700a1be933d82faaf596..157baf179e026ae3c81f00cecc6b9798dde46bbb 100644 (file)
@@ -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));
index a1773a33a2ace860101540e0d44f3d000c59ad7c..71b1a100a7c6e2fe2a6b07e582e079af1e2ea6e2 100644 (file)
@@ -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 ..
index 1a8f595a82224ed503ade2cbcb9f3909d6b9c33b..194bdfa9116058cb22a411dc4ad43082ab98ca56 100644 (file)
@@ -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; \
index 1fd4f4cc87a089785776e934766f55865241c2f9..dba2ee6929f46378c38cd66485d8c42617a332b8 100644 (file)
@@ -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*}\
index 2d28812bc2d8256553df9fab22aa5b0386271c2f..4256ca7fe3c92aa1d8b84cae30ce0eb83ceae08b 100644 (file)
@@ -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
index 7e8832f4ec7cc0fa8320b5e6ce0aeac68af91c68..a2bc12dc5348b752333c45520b5c7bfba6522309 100644 (file)
@@ -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}
     };
 
index 11e036ca38a7603b1f748b9de1aed148d0685a66..0486abd08f0c67da266a8606d751e6a27aec5026 100644 (file)
@@ -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;
index adc5951db4bd68edafcef88b9400a891923bdf4e..2fc64dc18821efd4fa7c848292961d3bdaace99d 100644 (file)
@@ -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);
index 0f41718efe4195671e19f400ab2cbca678985250..451a0906052380d618ee0e55dce9f01c58cf504a 100644 (file)
@@ -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)
index c7af4c72d4fd71bf5fd49552d6fcb8eba7354f69..11c5fd3c5c0733b40dc418e2c6aff375b4ad755f 100644 (file)
@@ -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*";