From b6de9da4445784d502e39b69359ae2cb5304589b Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 13 May 2010 22:04:58 +0000 Subject: [PATCH] 2010-05-13 Michael Snyder * bcache.c: White space. --- gdb/ChangeLog | 2 ++ gdb/bcache.c | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 409aa70..e48c5cc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2010-05-13 Michael Snyder + * bcache.c: White space. + * gdbarch.sh: White space, add blank lines. * arch-utils.c: Ditto. * gdbarch.c: Regenerate. 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; } -- 2.7.4