]> Git Repo - binutils.git/commitdiff
Remove streq_hash in favor of htab_eq_string
authorTom Tromey <[email protected]>
Fri, 7 May 2021 15:18:18 +0000 (09:18 -0600)
committerTom Tromey <[email protected]>
Fri, 7 May 2021 15:18:18 +0000 (09:18 -0600)
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.

gdb/ChangeLog
gdb/ada-lang.c
gdb/breakpoint.c
gdb/completer.c
gdb/utils.c
gdb/utils.h

index 45b048da4f53542ac7b0c13eb39c54db97f8b153..76ccb6beb3cfc975ad5c63568f2051d399217d9d 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2021-05-07  Simon Marchi  <[email protected]>
 
        * Re-format all Python files using black.
index e15e583adca08a509fe56b0069f8163c346349ed..34b0e925685fc5cd529bf75cf2e4633e2acc498e 100644 (file)
@@ -13490,7 +13490,8 @@ When enabled, the debugger will stop using the DW_AT_GNAT_descriptive_type\n\
 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.  */
index 35a891bb4b9568bbcbc0f6c2a88870ff7b9ebfef..38406b45856cef058854729e1aad884ffc337667 100644 (file)
@@ -13471,7 +13471,7 @@ static int
 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)
index 2330ad435a8ea83875197a855eabb28798ee3036..80e8c7b743e1a75d0a212a6980fd21b9b5790b9b 100644 (file)
@@ -1593,7 +1593,7 @@ completion_tracker::discard_completions ()
   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
index b9f8997ec80c7d27ab56f8358c6df76b79286283..1f48a5a0bfea5e8ecde4c7138771dce5ee057832 100644 (file)
@@ -2818,14 +2818,6 @@ streq (const char *lhs, const char *rhs)
   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
 
 /*
index b91e0d1ea34c26e6fe8d2c4dfd6466956f49aef1..94d37c5a8b1a8b2baa65209805aa893f23e76ee9 100644 (file)
@@ -99,11 +99,6 @@ extern int strcmp_iw_ordered (const char *, const char *);
 
 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.  */
This page took 0.056703 seconds and 4 git commands to generate.