From: Kaveh R. Ghazi Date: Wed, 31 Mar 1999 07:51:10 +0000 (+0000) Subject: Makefile.in (hash.h): Generate using gperf language 'C'... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8e6befc1df7d85f31b7d5ecf1fddb4183b707719;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 62c1821a0cb..06bb240f29c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi + + * 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 * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, diff --git a/gcc/cp/Makefile.in b/gcc/cp/Makefile.in index ef81437d2ae..ae156e66690 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 5632f7f34a5..42762e60998 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 71c2f317ffe..4cc867946b1 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];