diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-01 09:33:13 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-04-05 07:39:36 -0600 |
commit | 459a2e4ccf9aadfba9819facba1c9be5297c1625 (patch) | |
tree | 2209376112b15dd814aa718a0d3b1247fecc7fe9 /gdb/ada-lang.c | |
parent | 9be2c17a900178df75a2208fd112ceb4325a70c1 (diff) | |
download | binutils-gdb-459a2e4ccf9aadfba9819facba1c9be5297c1625.tar.gz |
Change streq to return bool
I wanted to use streq with std::unique in another (upcoming) patch in
this seres, so I changed it to return bool. To my surprise, this lead
to regressions. The cause turned out to be that streq was used as an
htab callback -- by casting it to the correct function type. This
sort of cast is invalid, so this patch adds a variant which is
directly suitable for use by htab. (Note that I did not add an
overload, as I could not get that to work with template deduction in
the other patch.)
ChangeLog
2018-04-05 Tom Tromey <tom@tromey.com>
* completer.c (completion_tracker::completion_tracker): Remove
cast.
(completion_tracker::discard_completions): Likewise.
* breakpoint.c (ambiguous_names_p): Remove cast.
* ada-lang.c (_initialize_ada_language): Remove cast.
* utils.h (streq): Update.
(streq_hash): Add new declaration.
* utils.c (streq): Return bool.
(streq_hash): New function.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 11939d77986..de20c43bedd 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -14722,9 +14722,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, (int (*)(const void *, const void *)) streq, - NULL, xcalloc, xfree); + decoded_names_store = htab_create_alloc (256, htab_hash_string, streq_hash, + NULL, xcalloc, xfree); /* The ada-lang observers. */ gdb::observers::new_objfile.attach (ada_new_objfile_observer); |