Written by Fred Fish <fnf@cygnus.com>
Rewritten by Jim Blandy <jimb@cygnus.com>
- Copyright (C) 1999-2014 Free Software Foundation, Inc.
+ Copyright (C) 1999-2015 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "gdb_obstack.h"
#include "bcache.h"
-#include <string.h> /* 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
/* 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;
if (added)
*added = 1;
- return &new->d.data;
+ return &newobj->d.data;
}
}
\f