Now that libiberty includes htab_eq_string, we can remove the
identical function from gdb.
gdb/ChangeLog
2021-05-07 Tom Tromey <
[email protected]>
* breakpoint.c (ambiguous_names_p): Use htab_eq_string.
* utils.c (streq_hash): Remove.
* utils.h (streq_hash): Don't declare.
* completer.c (completion_tracker::discard_completions): Update
comment.
* ada-lang.c (_initialize_ada_language): Use htab_eq_string.
+
+ * breakpoint.c (ambiguous_names_p): Use htab_eq_string.
+ * utils.c (streq_hash): Remove.
+ * utils.h (streq_hash): Don't declare.
+ * completer.c (completion_tracker::discard_completions): Update
+ comment.
+ * ada-lang.c (_initialize_ada_language): Use htab_eq_string.
+
* Re-format all Python files using black.
DWARF attribute."),
NULL, NULL, &maint_set_ada_cmdlist, &maint_show_ada_cmdlist);
- decoded_names_store = htab_create_alloc (256, htab_hash_string, streq_hash,
+ decoded_names_store = htab_create_alloc (256, htab_hash_string,
+ htab_eq_string,
NULL, xcalloc, xfree);
/* The ada-lang observers. */
ambiguous_names_p (struct bp_location *loc)
{
struct bp_location *l;
- htab_up htab (htab_create_alloc (13, htab_hash_string, streq_hash, NULL,
+ htab_up htab (htab_create_alloc (13, htab_hash_string, htab_eq_string, NULL,
xcalloc, xfree));
for (l = loc; l != NULL; l = l->next)
m_entries_hash.reset (nullptr);
/* A callback used by the hash table to compare new entries with existing
- entries. We can't use the standard streq_hash function here as the
+ entries. We can't use the standard htab_eq_string function here as the
key to our hash is just a single string, while the values we store in
the hash are a struct containing multiple strings. */
static auto entry_eq_func
return !strcmp (lhs, rhs);
}
-/* See utils.h. */
-
-int
-streq_hash (const void *lhs, const void *rhs)
-{
- return streq ((const char *) lhs, (const char *) rhs);
-}
-
\f
/*
extern bool streq (const char *, const char *);
-/* A variant of streq that is suitable for use as an htab
- callback. */
-
-extern int streq_hash (const void *, const void *);
-
extern int subset_compare (const char *, const char *);
/* Compare C strings for std::sort. */