X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fbcache.c;h=06ab843d3ac6fe4ebdadd866f4c81f85565c0a58;hb=858c9d13240e695bc3b750368f5d4e524b12112e;hp=44530bcf7e5de69449fcc5bc96306313708e5ded;hpb=8ebb3f5606b361b30e854335fa5a9ce0fd018d41;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/bcache.c b/gdb/bcache.c index 44530bcf7e..06ab843d3a 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -2,7 +2,7 @@ Written by Fred Fish Rewritten by Jim Blandy - Copyright (C) 1999-2014 Free Software Foundation, Inc. + Copyright (C) 1999-2017 Free Software Foundation, Inc. This file is part of GDB. @@ -22,8 +22,6 @@ #include "defs.h" #include "gdb_obstack.h" #include "bcache.h" -#include /* For memcpy declaration */ -#include "gdb_assert.h" /* The type used to hold a single bcache string. The user data is stored in d.data. Since it can be any type, it needs to have the @@ -266,14 +264,15 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added) /* The user's string isn't in the list. Insert it after *ps. */ { - struct bstring *new - = obstack_alloc (&bcache->cache, BSTRING_SIZE (length)); + struct bstring *newobj + = (struct bstring *) obstack_alloc (&bcache->cache, + BSTRING_SIZE (length)); - memcpy (&new->d.data, addr, length); - new->length = length; - new->next = bcache->bucket[hash_index]; - new->half_hash = half_hash; - bcache->bucket[hash_index] = new; + memcpy (&newobj->d.data, addr, length); + newobj->length = length; + newobj->next = bcache->bucket[hash_index]; + newobj->half_hash = half_hash; + bcache->bucket[hash_index] = newobj; bcache->unique_count++; bcache->unique_size += length; @@ -282,7 +281,7 @@ bcache_full (const void *addr, int length, struct bcache *bcache, int *added) if (added) *added = 1; - return &new->d.data; + return &newobj->d.data; } } @@ -357,7 +356,7 @@ print_percentage (int portion, int total) BCACHE holds. Statistics are printed using `printf_filtered' and its ilk. */ void -print_bcache_statistics (struct bcache *c, char *type) +print_bcache_statistics (struct bcache *c, const char *type) { int occupied_buckets; int max_chain_length;