bcache_full.
(append_psymbol_to_list): Accept a const pointer.
(add_psymbol_to_list): Fix const correctness.
* bcache.h: (deprecated_bcache_added, deprecated_bcache): Remove.
(bcache_full): Declare.
* bcache.c (bcache_data, deprecated_bcache): Remove.
(bcache): Use bcache_full.
(bcache_full): Rename from deprecated_bcache_added. Change return
type.
+2008-08-05 Tom Tromey <tromey@redhat.com>
+
+ * symfile.c (add_psymbol_to_bcache): Return a const pointer. Use
+ bcache_full.
+ (append_psymbol_to_list): Accept a const pointer.
+ (add_psymbol_to_list): Fix const correctness.
+ * bcache.h: (deprecated_bcache_added, deprecated_bcache): Remove.
+ (bcache_full): Declare.
+ * bcache.c (bcache_data, deprecated_bcache): Remove.
+ (bcache): Use bcache_full.
+ (bcache_full): Rename from deprecated_bcache_added. Change return
+ type.
+
2008-08-04 Stan Shebs <stan@codesourcery.com>
* solib-svr4.c (BKPT_AT_SYMBOL): Remove, always defined.
/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
never seen those bytes before, add a copy of them to BCACHE. In
either case, return a pointer to BCACHE's copy of that string. */
-static void *
-bcache_data (const void *addr, int length, struct bcache *bcache)
-{
- return deprecated_bcache_added (addr, length, bcache, NULL);
-}
-
-
-void *
-deprecated_bcache (const void *addr, int length, struct bcache *bcache)
-{
- return bcache_data (addr, length, bcache);
-}
-
const void *
bcache (const void *addr, int length, struct bcache *bcache)
{
- return bcache_data (addr, length, bcache);
+ return bcache_full (addr, length, bcache, NULL);
}
/* Find a copy of the LENGTH bytes at ADDR in BCACHE. If BCACHE has
optional ADDED is not NULL, return 1 in case of new entry or 0 if
returning an old entry. */
-void *
-deprecated_bcache_added (const void *addr, int length, struct bcache *bcache,
- int *added)
+const void *
+bcache_full (const void *addr, int length, struct bcache *bcache, int *added)
{
unsigned long full_hash;
unsigned short half_hash;
either case, return a pointer to BCACHE's copy of that string.
Since the cached value is ment to be read-only, return a const
buffer. */
-extern void *deprecated_bcache (const void *addr, int length,
- struct bcache *bcache);
extern const void *bcache (const void *addr, int length,
struct bcache *bcache);
-extern void *deprecated_bcache_added (const void *addr, int length,
- struct bcache *bcache, int *added);
+/* Like bcache, but if ADDED is not NULL, set *ADDED to true if the
+ bytes were newly added to the cache, or to false if the bytes were
+ found in the cache. */
+extern const void *bcache_full (const void *addr, int length,
+ struct bcache *bcache, int *added);
+
/* Free all the storage used by BCACHE. */
extern void bcache_xfree (struct bcache *bcache);
structure. In other words, having two symbols with the same name but
different domain (or address) is possible and correct. */
-static struct partial_symbol *
+static const struct partial_symbol *
add_psymbol_to_bcache (char *name, int namelength, domain_enum domain,
enum address_class class,
long val, /* Value as a long */
SYMBOL_SET_NAMES (&psymbol, buf, namelength, objfile);
/* Stash the partial symbol away in the cache */
- return deprecated_bcache_added (&psymbol, sizeof (struct partial_symbol),
- objfile->psymbol_cache, added);
+ return bcache_full (&psymbol, sizeof (struct partial_symbol),
+ objfile->psymbol_cache, added);
}
/* Helper function, adds partial symbol to the given partial symbol
static void
append_psymbol_to_list (struct psymbol_allocation_list *list,
- struct partial_symbol *psym,
+ const struct partial_symbol *psym,
struct objfile *objfile)
{
if (list->next >= list->list + list->size)
extend_psymbol_list (list, objfile);
- *list->next++ = psym;
+ *list->next++ = (struct partial_symbol *) psym;
OBJSTAT (objfile, n_psyms++);
}
CORE_ADDR coreaddr, /* Value as a CORE_ADDR */
enum language language, struct objfile *objfile)
{
- struct partial_symbol *psym;
+ const struct partial_symbol *psym;
int added;