This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch installed for various const-ifications


This patch adds the "const" keyword in a bunch of places and also adds
"static" in a few others.  I also added the -C option to gperf in the
java directory which bassically adds "const" to the arrays it puts in
the generated output file.  (I included the generated file in this
patch in case anyone is interested, it's not too long.)  There should
be no change in gcc behavior.

Nevertheless, I of course tested via full bootstrap on
sparc-sun-solaris2.7 and cross-compiles of cc1 in my target farm.

There were no warning or testsuite regressions so I installed it as
obvious.

		--Kaveh

PS: I got around 2K - 2.3K moved from .data to .rodata in f771 and jc1.


2001-12-22  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.
	
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.

diff -rup orig/egcc-CVS20011221/gcc/config/arc/arc.c egcc-CVS20011221/gcc/config/arc/arc.c
--- orig/egcc-CVS20011221/gcc/config/arc/arc.c	Mon Dec 17 11:33:19 2001
+++ egcc-CVS20011221/gcc/config/arc/arc.c	Sat Dec 22 08:12:11 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/config/arc/arc.h egcc-CVS20011221/gcc/config/arc/arc.h
--- orig/egcc-CVS20011221/gcc/config/arc/arc.h	Thu Dec 20 16:30:14 2001
+++ egcc-CVS20011221/gcc/config/arc/arc.h	Sat Dec 22 08:00:15 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/config/i386/i386.c egcc-CVS20011221/gcc/config/i386/i386.c
--- orig/egcc-CVS20011221/gcc/config/i386/i386.c	Tue Dec 18 16:30:29 2001
+++ egcc-CVS20011221/gcc/config/i386/i386.c	Sat Dec 22 09:54:02 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/config/m68k/m68k.c egcc-CVS20011221/gcc/config/m68k/m68k.c
--- orig/egcc-CVS20011221/gcc/config/m68k/m68k.c	Mon Dec 17 11:33:31 2001
+++ egcc-CVS20011221/gcc/config/m68k/m68k.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/config/m68k/m68k.h egcc-CVS20011221/gcc/config/m68k/m68k.h
--- orig/egcc-CVS20011221/gcc/config/m68k/m68k.h	Thu Dec 20 16:30:23 2001
+++ egcc-CVS20011221/gcc/config/m68k/m68k.h	Fri Dec 21 22:38:14 2001
@@ -749,7 +749,7 @@ enum reg_class { NO_REGS, LO_FPA_REGS, F
    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 -rup orig/egcc-CVS20011221/gcc/config/mcore/mcore.c egcc-CVS20011221/gcc/config/mcore/mcore.c
--- orig/egcc-CVS20011221/gcc/config/mcore/mcore.c	Mon Dec 17 11:33:33 2001
+++ egcc-CVS20011221/gcc/config/mcore/mcore.c	Sat Dec 22 08:26:49 2001
@@ -73,7 +73,7 @@ int regno_reg_class[FIRST_PSEUDO_REGISTE
 
 /* 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 -rup orig/egcc-CVS20011221/gcc/config/mcore/mcore.h egcc-CVS20011221/gcc/config/mcore/mcore.h
--- orig/egcc-CVS20011221/gcc/config/mcore/mcore.h	Thu Dec 20 16:30:24 2001
+++ egcc-CVS20011221/gcc/config/mcore/mcore.h	Fri Dec 21 22:38:14 2001
@@ -544,7 +544,7 @@ extern int regno_reg_class[];
 
 /* 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 -rup orig/egcc-CVS20011221/gcc/config/sh/sh.c egcc-CVS20011221/gcc/config/sh/sh.c
--- orig/egcc-CVS20011221/gcc/config/sh/sh.c	Mon Dec 17 11:33:39 2001
+++ egcc-CVS20011221/gcc/config/sh/sh.c	Sat Dec 22 11:04:27 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/config/sh/sh.h egcc-CVS20011221/gcc/config/sh/sh.h
--- orig/egcc-CVS20011221/gcc/config/sh/sh.h	Thu Dec 20 16:30:27 2001
+++ egcc-CVS20011221/gcc/config/sh/sh.h	Sat Dec 22 11:01:45 2001
@@ -829,7 +829,7 @@ extern int regno_reg_class[];
 
 /* 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 -rup orig/egcc-CVS20011221/gcc/config/sparc/sparc.c egcc-CVS20011221/gcc/config/sparc/sparc.c
--- orig/egcc-CVS20011221/gcc/config/sparc/sparc.c	Thu Dec 20 07:30:31 2001
+++ egcc-CVS20011221/gcc/config/sparc/sparc.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/config/sparc/sparc.h egcc-CVS20011221/gcc/config/sparc/sparc.h
--- orig/egcc-CVS20011221/gcc/config/sparc/sparc.h	Thu Dec 20 16:30:27 2001
+++ egcc-CVS20011221/gcc/config/sparc/sparc.h	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/cp/decl2.c egcc-CVS20011221/gcc/cp/decl2.c
--- orig/egcc-CVS20011221/gcc/cp/decl2.c	Tue Dec 18 07:30:31 2001
+++ egcc-CVS20011221/gcc/cp/decl2.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/f/com.c egcc-CVS20011221/gcc/f/com.c
--- orig/egcc-CVS20011221/gcc/f/com.c	Fri Dec 14 16:30:27 2001
+++ egcc-CVS20011221/gcc/f/com.c	Fri Dec 21 22:38:14 2001
@@ -437,7 +437,7 @@ static const char *const ffecom_gfrt_nam
 
 /* 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
 
 /* 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_
 /* 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_gf
 
 /* 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 -rup orig/egcc-CVS20011221/gcc/gcc.c egcc-CVS20011221/gcc/gcc.c
--- orig/egcc-CVS20011221/gcc/gcc.c	Sat Dec 15 16:30:18 2001
+++ egcc-CVS20011221/gcc/gcc.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/gengenrtl.c egcc-CVS20011221/gcc/gengenrtl.c
--- orig/egcc-CVS20011221/gcc/gengenrtl.c	Sat Dec  1 07:30:24 2001
+++ egcc-CVS20011221/gcc/gengenrtl.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/java/Make-lang.in egcc-CVS20011221/gcc/java/Make-lang.in
--- orig/egcc-CVS20011221/gcc/java/Make-lang.in	Sun Dec 16 13:34:29 2001
+++ egcc-CVS20011221/gcc/java/Make-lang.in	Fri Dec 21 22:38:14 2001
@@ -90,7 +90,7 @@ $(srcdir)/java/parse-scan.c:  $(srcdir)/
 
 $(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 -rup orig/egcc-CVS20011221/gcc/java/jvspec.c egcc-CVS20011221/gcc/java/jvspec.c
--- orig/egcc-CVS20011221/gcc/java/jvspec.c	Sat Dec 15 07:30:28 2001
+++ egcc-CVS20011221/gcc/java/jvspec.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/java/keyword.gperf egcc-CVS20011221/gcc/java/keyword.gperf
--- orig/egcc-CVS20011221/gcc/java/keyword.gperf	Wed Sep 12 12:05:28 2001
+++ egcc-CVS20011221/gcc/java/keyword.gperf	Fri Dec 21 22:38:14 2001
@@ -25,7 +25,7 @@ of Sun Microsystems, Inc. in the United 
 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
 #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 -rup orig/egcc-CVS20011221/gcc/java/keyword.h egcc-CVS20011221/gcc/java/keyword.h
--- orig/egcc-CVS20011221/gcc/java/keyword.h	Wed Sep 12 12:05:28 2001
+++ egcc-CVS20011221/gcc/java/keyword.h	Fri Dec 21 22:38:14 2001
@@ -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 tradem
 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
 #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
 
 #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 -rup orig/egcc-CVS20011221/gcc/java/lang.c egcc-CVS20011221/gcc/java/lang.c
--- orig/egcc-CVS20011221/gcc/java/lang.c	Sat Dec 22 08:42:21 2001
+++ egcc-CVS20011221/gcc/java/lang.c	Fri Dec 21 22:38:21 2001
@@ -43,9 +43,9 @@ The Free Software Foundation is independ
 
 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 ((con
 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 = LAN
    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 -rup orig/egcc-CVS20011221/gcc/java/lex.c egcc-CVS20011221/gcc/java/lex.c
--- orig/egcc-CVS20011221/gcc/java/lex.c	Sun Dec 16 13:34:30 2001
+++ egcc-CVS20011221/gcc/java/lex.c	Fri Dec 21 22:38:14 2001
@@ -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 -rup orig/egcc-CVS20011221/gcc/reload1.c egcc-CVS20011221/gcc/reload1.c
--- orig/egcc-CVS20011221/gcc/reload1.c	Mon Dec 17 16:30:34 2001
+++ egcc-CVS20011221/gcc/reload1.c	Fri Dec 21 22:38:14 2001
@@ -323,10 +323,10 @@ static struct elim_table *reg_eliminate 
 
 /* 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 -rup orig/egcc-CVS20011221/gcc/tradcpp.c egcc-CVS20011221/gcc/tradcpp.c
--- orig/egcc-CVS20011221/gcc/tradcpp.c	Sun Dec 16 08:55:33 2001
+++ egcc-CVS20011221/gcc/tradcpp.c	Fri Dec 21 22:38:14 2001
@@ -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*";
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]