summaryrefslogtreecommitdiff
path: root/gcc/scan.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-02-08 21:27:02 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-02-08 21:27:02 +0000
commit5fa7f88c064df849718157fb4e90fa865e35fb5b (patch)
treedc89fdbfec79835dff420526e91afe6ae04f9ca8 /gcc/scan.c
parent4be2e5d967e76bdec83d5b6d08d7b9c5ccacad75 (diff)
downloadgcc-5fa7f88c064df849718157fb4e90fa865e35fb5b.tar.gz
Makefile.in (GEN_PROTOS_OBJS): Remove libcpp.a.
* Makefile.in (GEN_PROTOS_OBJS): Remove libcpp.a. (gen_protos.o): Don't depend on cpplib.h or cpphash.h. (fix-header.o): Don't depend on cpphash.h. * scan.c (hashstr): New function. * scan.h: Prototype it. * fix-header.c: Don't include cpphash.h. Use hashstr. * gen-protos.c: Don't include cpphash.h or cpplib.h. Use hashstr. Report hash table statistics. Add private definition of xrealloc. From-SVN: r31854
Diffstat (limited to 'gcc/scan.c')
-rw-r--r--gcc/scan.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/scan.c b/gcc/scan.c
index 24dd6632f35..4af6a43a702 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -236,3 +236,18 @@ get_token (fp, s)
*s->ptr = 0;
return c;
}
+
+unsigned int
+hashstr (str, len)
+ const char *str;
+ unsigned int len;
+{
+ unsigned int n = len;
+ unsigned int r = 0;
+ const unsigned char *s = (const unsigned char *)str;
+
+ do
+ r = r * 67 + (*s++ - 113);
+ while (--n);
+ return r + len;
+}