Commit 8e6befc1 by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 63e5baa6
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> 1999-03-30 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST,
......
...@@ -245,7 +245,7 @@ $(PARSE_C) : $(srcdir)/parse.y ...@@ -245,7 +245,7 @@ $(PARSE_C) : $(srcdir)/parse.y
# the C front-end already requires this if c-parse.gperf is changed, # the C front-end already requires this if c-parse.gperf is changed,
# so we should be consistent. # so we should be consistent.
$(srcdir)/hash.h: $(srcdir)/gxx.gperf $(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 '-k1,4,7,$$' $(srcdir)/gxx.gperf >$(srcdir)/hash.h
spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \ spew.o : spew.c $(CONFIG_H) $(CXX_TREE_H) $(PARSE_H) $(srcdir)/../flags.h \
......
%{ %{
/* Command-line: gperf -L KR-C -F ', 0, 0' -p -j1 -g -o -t -N is_reserved_word -k1,4,$,7 gplus.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;};
%% %%
__alignof, ALIGNOF, NORID __alignof, ALIGNOF, NORID
__alignof__, ALIGNOF, NORID __alignof__, ALIGNOF, NORID
......
/* KR-C code produced by gperf version 2.7.1 (19981006 egcs) */ /* 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 */ /* 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 */ /* 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 TOTAL_KEYWORDS 106
#define MIN_WORD_LENGTH 2 #define MIN_WORD_LENGTH 2
...@@ -15,7 +15,7 @@ __inline ...@@ -15,7 +15,7 @@ __inline
#endif #endif
static unsigned int static unsigned int
hash (str, len) hash (str, len)
register char *str; register const char *str;
register unsigned int len; register unsigned int len;
{ {
static unsigned char asso_values[] = static unsigned char asso_values[] =
...@@ -72,7 +72,7 @@ __inline ...@@ -72,7 +72,7 @@ __inline
#endif #endif
struct resword * struct resword *
is_reserved_word (str, len) is_reserved_word (str, len)
register char *str; register const char *str;
register unsigned int len; register unsigned int len;
{ {
static struct resword wordlist[] = static struct resword wordlist[] =
...@@ -227,7 +227,7 @@ is_reserved_word (str, len) ...@@ -227,7 +227,7 @@ is_reserved_word (str, len)
if (key <= MAX_HASH_VALUE && key >= 0) 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)) if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key]; return &wordlist[key];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment