diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2000-06-05 20:49:53 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2000-06-05 20:49:53 +0000 |
commit | 357e46e7c9f18a0603aa9a6de440bedb147e57f8 (patch) | |
tree | 7a636a8075ad6888e5c2401e87c859f74c526183 /gdb/buildsym.c | |
parent | e6d71bf34e01d840417e4fac1bcedae5fff5b9dc (diff) | |
download | gdb-357e46e7c9f18a0603aa9a6de440bedb147e57f8.zip gdb-357e46e7c9f18a0603aa9a6de440bedb147e57f8.tar.gz gdb-357e46e7c9f18a0603aa9a6de440bedb147e57f8.tar.bz2 |
C++ improvements
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c index dff9293..70105be 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -36,7 +36,7 @@ #include "gdb_string.h" #include "expression.h" /* For "enum exp_opcode" used by... */ #include "language.h" /* For "longest_local_hex_string_custom" */ - +#include "bcache.h" /* Ask buildsym.h to define the vars it normally declares `extern'. */ #define EXTERN /**/ @@ -1055,33 +1055,13 @@ push_context (int desc, CORE_ADDR valu) return new; } + /* Compute a small integer hash code for the given name. */ int hashname (char *name) { - register char *p = name; - register int total = p[0]; - register int c; - - c = p[1]; - total += c << 2; - if (c) - { - c = p[2]; - total += c << 4; - if (c) - { - total += p[3] << 6; - } - } - - /* Ensure result is positive. */ - if (total < 0) - { - total += (1000 << 6); - } - return (total % HASHSIZE); + return (hash(name,strlen(name)) % HASHSIZE); } |