public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Use 'bool' more idiomatically in dwarf_decode_lines
@ 2021-07-03 17:41 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2021-07-03 17:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

I noticed a couple of spots related to dwarf_decode_lines where the
'include_p' field was not being used idiomatically -- it is of type
bool now, so treat it as such.

gdb/ChangeLog
2021-07-03  Tom Tromey  <tom@tromey.com>

	* dwarf2/read.c (lnp_state_machine::record_line): Use 'true'.
	(dwarf_decode_lines): Remove '=='.
---
 gdb/ChangeLog     | 5 +++++
 gdb/dwarf2/read.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 760d4319c29..fe82175990e 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -20997,7 +20997,7 @@ lnp_state_machine::record_line (bool end_sequence)
      previous version of the code.  */
   else if (m_op_index == 0 || end_sequence)
     {
-      fe->included_p = 1;
+      fe->included_p = true;
       if (m_record_lines_p)
 	{
 	  /* When we switch files we insert an end maker in the first file,
@@ -21368,7 +21368,7 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir,
       /* Now that we're done scanning the Line Header Program, we can
 	 create the psymtab of each included file.  */
       for (auto &file_entry : lh->file_names ())
-	if (file_entry.included_p == 1)
+	if (file_entry.included_p)
 	  {
 	    gdb::unique_xmalloc_ptr<char> name_holder;
 	    const char *include_name =
-- 
2.26.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-03 17:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 17:41 [pushed] Use 'bool' more idiomatically in dwarf_decode_lines Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).