aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-03-31 07:51:10 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-03-31 07:51:10 +0000
commit8e6befc1df7d85f31b7d5ecf1fddb4183b707719 (patch)
treed0940e743393756f9506c468ec12116f403c9dee /gcc
parent63e5baa6c94c623a07cf32c8dd67ab9c08a71b73 (diff)
downloadgcc-8e6befc1df7d85f31b7d5ecf1fddb4183b707719.zip
gcc-8e6befc1df7d85f31b7d5ecf1fddb4183b707719.tar.gz
gcc-8e6befc1df7d85f31b7d5ecf1fddb4183b707719.tar.bz2
Makefile.in (hash.h): Generate using gperf language 'C'...
* Makefile.in (hash.h): Generate using gperf language 'C', not 'KR-C', so gperf uses the `const' keyword on strings. * gxx.gperf (resword): Const-ify a char*. From-SVN: r26081
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/Makefile.in2
-rw-r--r--gcc/cp/gxx.gperf2
-rw-r--r--gcc/cp/hash.h12
4 files changed, 15 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 62c1821..06bb240 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (hash.h): Generate using gperf language 'C', not
+ 'KR-C', so gperf uses the `const' keyword on strings.
+
+ * gxx.gperf (resword): Const-ify a char*.
+
1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in
index ef81437..ae156e6 100644
--- a/gcc/cp/Makefile.in
+++ b/gcc/cp/Makefile.in
@@ -245,7 +245,7 @@ $(PARSE_C) : $(srcdir)/parse.y
# the C front-end already requires this if c-parse.gperf is changed,
# so we should be consistent.
$(srcdir)/hash.h: $(srcdir)/gxx.gperf
- gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
+ gperf -L C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word \
'-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h
spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
diff --git a/gcc/cp/gxx.gperf b/gcc/cp/gxx.gperf
index 5632f7f..42762e6 100644
--- a/gcc/cp/gxx.gperf
+++ b/gcc/cp/gxx.gperf
@@ -1,7 +1,7 @@
%{
/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
%}
-struct resword { char *name; short token; enum rid rid;};
+struct resword { const char *name; short token; enum rid rid;};
%%
__alignof, ALIGNOF, NORID
__alignof__, ALIGNOF, NORID
diff --git a/gcc/cp/hash.h b/gcc/cp/hash.h
index 71c2f31..4cc8679 100644
--- a/gcc/cp/hash.h
+++ b/gcc/cp/hash.h
@@ -1,7 +1,7 @@
-/* KR-C code produced by gperf version 2.7.1 (19981006 egcs) */
-/* Command-line: gperf -L KR-C -F , 0, 0 -p -j1 -g -o -t -N is_reserved_word -k1,4,7,$ ../../../gcc/cp/gxx.gperf */
+/* C code produced by gperf version 2.7.1 (19981006 egcs) */
+/* Command-line: gperf -L C -F , 0, 0 -p -j1 -g -o -t -N is_reserved_word -k1,4,7,$ ./gxx.gperf */
/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.gperf */
-struct resword { char *name; short token; enum rid rid;};
+struct resword { const char *name; short token; enum rid rid;};
#define TOTAL_KEYWORDS 106
#define MIN_WORD_LENGTH 2
@@ -15,7 +15,7 @@ __inline
#endif
static unsigned int
hash (str, len)
- register char *str;
+ register const char *str;
register unsigned int len;
{
static unsigned char asso_values[] =
@@ -72,7 +72,7 @@ __inline
#endif
struct resword *
is_reserved_word (str, len)
- register char *str;
+ register const char *str;
register unsigned int len;
{
static struct resword wordlist[] =
@@ -227,7 +227,7 @@ is_reserved_word (str, len)
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register char *s = wordlist[key].name;
+ register const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];