Use bool in pc_in_* functions

I noticed that pc_in_unmapped_range had a weird return type -- it was
returning a CORE_ADDR but intending to return a bool.  This patch
changes all the pc_in_* functions to return bool instead.
This commit is contained in:
Tom Tromey
2023-01-18 16:36:52 -07:00
parent 42938c1a5b
commit 6ec27270ff
6 changed files with 17 additions and 22 deletions

View File

@@ -1208,18 +1208,13 @@ find_pc_section (CORE_ADDR pc)
/* Return non-zero if PC is in a section called NAME. */
int
bool
pc_in_section (CORE_ADDR pc, const char *name)
{
struct obj_section *s;
int retval = 0;
s = find_pc_section (pc);
retval = (s != NULL
&& s->the_bfd_section->name != NULL
&& strcmp (s->the_bfd_section->name, name) == 0);
return (retval);
struct obj_section *s = find_pc_section (pc);
return (s != nullptr
&& s->the_bfd_section->name != nullptr
&& strcmp (s->the_bfd_section->name, name) == 0);
}