aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-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
7 files changed, 43 insertions, 25 deletions
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);