From: Tom Tromey Date: Sun, 8 Oct 2017 02:13:42 +0000 (-0600) Subject: Use bool in pv_area X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a900ff724a725ea951ba8b17232577e1a4b4866e;p=binutils-gdb.git Use bool in pv_area This updates a couple of member functions in pv_area to return bool. gdb/ChangeLog 2017-10-12 Tom Tromey * prologue-value.h (pv_area::store_would_trash): Return bool. (pv_area::find_reg): Likewise. * prologue-value.c (pv_area::store_would_trash): Return bool. (pv_area::find_reg): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 31a9a2687d1..65a32657371 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2017-10-12 Tom Tromey + + * prologue-value.h (pv_area::store_would_trash): Return bool. + (pv_area::find_reg): Likewise. + * prologue-value.c (pv_area::store_would_trash): Return bool. + (pv_area::find_reg): Likewise. + 2017-10-12 Tom Tromey * s390-linux-tdep.c (s390_store, s390_load) diff --git a/gdb/prologue-value.c b/gdb/prologue-value.c index c602fe13abc..bec8422d3a7 100644 --- a/gdb/prologue-value.c +++ b/gdb/prologue-value.c @@ -341,7 +341,7 @@ pv_area::~pv_area () /* See prologue-value.h. */ -int +bool pv_area::store_would_trash (pv_t addr) { /* It may seem odd that pvk_constant appears here --- after all, @@ -492,7 +492,7 @@ pv_area::fetch (pv_t addr, CORE_ADDR size) /* See prologue-value.h. */ -int +bool pv_area::find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p) { struct area_entry *e = m_entry; @@ -507,14 +507,14 @@ pv_area::find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p) { if (offset_p) *offset_p = e->offset; - return 1; + return true; } e = e->next; } while (e != m_entry); - return 0; + return false; } diff --git a/gdb/prologue-value.h b/gdb/prologue-value.h index e3004aa6adc..c6fd34bdab9 100644 --- a/gdb/prologue-value.h +++ b/gdb/prologue-value.h @@ -269,7 +269,7 @@ public: prologue analysis, and return the information you've gathered, instead of losing all that information, most of which is probably okay. */ - int store_would_trash (pv_t addr); + bool store_would_trash (pv_t addr); /* Search AREA for the original value of REGISTER. If we can't find it, return zero; if we can find it, return a non-zero value, and if @@ -280,7 +280,7 @@ public: items stored in AREA. If you plan to gather a lot of information about registers saved in AREA, consider calling pv_area::scan instead, and collecting all your information in one pass. */ - int find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p); + bool find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p); /* For every part of AREA whose value we know, apply FUNC to CLOSURE,