X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fbcache.c;h=f3abc12a10e2351db126c4da253865ee707d71e1;hb=dac804dfa6389b71f50b5e169ffa4e239958e774;hp=99e9184ef6d0bb156028554cb6ece63f6ac1d121;hpb=fc270c357a3301fec8cc161199242bb934203cf6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/bcache.c b/gdb/bcache.c index 99e9184ef6..f3abc12a10 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-2015 Free Software Foundation, Inc. This file is part of GDB. @@ -22,11 +22,6 @@ #include "defs.h" #include "gdb_obstack.h" #include "bcache.h" -#include /* For memcpy declaration */ -#include "gdb_assert.h" - -#include -#include /* 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 @@ -269,14 +264,14 @@ 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 + struct bstring *newobj = 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; @@ -285,7 +280,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; } }