Change streq to return bool
authorTom Tromey <tom@tromey.com>
Sun, 1 Apr 2018 15:33:13 +0000 (09:33 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 5 Apr 2018 13:39:36 +0000 (07:39 -0600)
commit459a2e4ccf9aadfba9819facba1c9be5297c1625
tree2209376112b15dd814aa718a0d3b1247fecc7fe9
parent9be2c17a900178df75a2208fd112ceb4325a70c1
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.
gdb/ChangeLog
gdb/ada-lang.c
gdb/breakpoint.c
gdb/completer.c
gdb/utils.c
gdb/utils.h
This page took 0.025523 seconds and 4 git commands to generate.