diff options
author | Michael Snyder <msnyder@vmware.com> | 2010-05-13 22:04:58 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2010-05-13 22:04:58 +0000 |
commit | b6de9da4445784d502e39b69359ae2cb5304589b (patch) | |
tree | 44e452d701e484a6b6d75c322dc140ca7a7ca1d9 /gdb/bcache.c | |
parent | 05c547f629815fdd47930f9645269ea71c32373f (diff) | |
download | gdb-b6de9da4445784d502e39b69359ae2cb5304589b.zip gdb-b6de9da4445784d502e39b69359ae2cb5304589b.tar.gz gdb-b6de9da4445784d502e39b69359ae2cb5304589b.tar.bz2 |
2010-05-13 Michael Snyder <msnyder@vmware.com>
* bcache.c: White space.
Diffstat (limited to 'gdb/bcache.c')
-rw-r--r-- | gdb/bcache.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gdb/bcache.c b/gdb/bcache.c index 4badf6e..7d9180c 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -98,17 +98,17 @@ struct bcache unsigned long hash(const void *addr, int length) { - const unsigned char *k, *e; - unsigned long h; - - k = (const unsigned char *)addr; - e = k+length; - for (h=0; k< e;++k) - { - h *=16777619; - h ^= *k; - } - return (h); + const unsigned char *k, *e; + unsigned long h; + + k = (const unsigned char *)addr; + e = k+length; + for (h=0; k< e;++k) + { + h *=16777619; + h ^= *k; + } + return (h); } /* Growing the bcache's hash table. */ @@ -152,6 +152,7 @@ expand_hash_table (struct bcache *bcache) /* Allocate the new table. */ { size_t new_size = new_num_buckets * sizeof (new_buckets[0]); + new_buckets = (struct bstring **) xmalloc (new_size); memset (new_buckets, 0, new_size); @@ -257,6 +258,7 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added) { struct bstring *new = obstack_alloc (&bcache->cache, BSTRING_SIZE (length)); + memcpy (&new->d.data, addr, length); new->length = length; new->next = bcache->bucket[hash_index]; @@ -281,6 +283,7 @@ bcache_xmalloc (void) { /* Allocate the bcache pre-zeroed. */ struct bcache *b = XCALLOC (1, struct bcache); + return b; } |