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.
        * gperf (resword): Const-ify a char*.

From-SVN: r26080
This commit is contained in:
Kaveh R. Ghazi 1999-03-31 07:48:00 +00:00 committed by Kaveh Ghazi
parent 0728688f0e
commit 63e5baa6c9
4 changed files with 16 additions and 9 deletions

View File

@ -1,3 +1,10 @@
Wed Mar 31 10:44:47 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.
* gperf (resword): Const-ify a char*.
Sun Mar 28 00:30:36 1999 Jeffrey A Law (law@cygnus.com) Sun Mar 28 00:30:36 1999 Jeffrey A Law (law@cygnus.com)
* Make-lang.in (CHILL.dvi): New target. * Make-lang.in (CHILL.dvi): New target.

View File

@ -266,7 +266,7 @@ $(srcdir)/hash.h:
gawk '{ printf ("s/^%s,/%s,/\n", $$1, toupper ($$1)) }' < gperf.tmp > sed.tmp gawk '{ printf ("s/^%s,/%s,/\n", $$1, toupper ($$1)) }' < gperf.tmp > sed.tmp
sed -f sed.tmp < gperf.tmp > gperf.tmp2 sed -f sed.tmp < gperf.tmp > gperf.tmp2
cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp cat $(srcdir)/gperf gperf.tmp2 > gperf.tmp
gperf -L KR-C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \ gperf -L C -F ', 0, 0, 0' -D -E -S1 -p -j1 -i 1 -g -o -t -k'*' \
gperf.tmp > $(srcdir)/hash.h gperf.tmp > $(srcdir)/hash.h
$(RM) gperf.tmp gperf.tmp2 sed.tmp $(RM) gperf.tmp gperf.tmp2 sed.tmp

View File

@ -1,5 +1,5 @@
struct resword { struct resword {
char *name; const char *name;
short token; short token;
enum rid rid; enum rid rid;
enum toktype { RESERVED, DIRECTIVE, PREDEF } flags; enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;

View File

@ -1,7 +1,7 @@
/* 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, 0 -D -E -S1 -p -j1 -i 1 -g -o -t -k* gperf.tmp */ /* Command-line: gperf -L C -F , 0, 0, 0 -D -E -S1 -p -j1 -i 1 -g -o -t -k* gperf.tmp */
struct resword { struct resword {
char *name; const char *name;
short token; short token;
enum rid rid; enum rid rid;
enum toktype { RESERVED, DIRECTIVE, PREDEF } flags; enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
@ -14,7 +14,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 short asso_values[] = static unsigned short asso_values[] =
@ -121,7 +121,7 @@ __inline
#endif #endif
struct resword * struct resword *
in_word_set (str, len) in_word_set (str, len)
register char *str; register const char *str;
register unsigned int len; register unsigned int len;
{ {
enum enum
@ -1342,7 +1342,7 @@ in_word_set (str, len)
multicompare: multicompare:
while (wordptr < wordendptr) while (wordptr < wordendptr)
{ {
register char *s = wordptr->name; register const char *s = wordptr->name;
if (*str == *s && !strcmp (str + 1, s + 1)) if (*str == *s && !strcmp (str + 1, s + 1))
return wordptr; return wordptr;
@ -1351,7 +1351,7 @@ in_word_set (str, len)
return 0; return 0;
compare: compare:
{ {
register char *s = resword->name; register const char *s = resword->name;
if (*str == *s && !strcmp (str + 1, s + 1)) if (*str == *s && !strcmp (str + 1, s + 1))
return resword; return resword;