]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Boolify line-program.c
authorTom Tromey <tom@tromey.com>
Sat, 6 Sep 2025 19:08:56 +0000 (13:08 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 9 Sep 2025 00:52:48 +0000 (18:52 -0600)
This changes some code in line-program.c to use bool rather than int.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/dwarf2/line-program.c
gdb/dwarf2/line-program.h

index 72bdd1f5a748ce228114105597b1e5a162254f69..46427b0081bc345cce82d53bf61d6b0285ab3a79 100644 (file)
@@ -261,7 +261,7 @@ lnp_state_machine::handle_const_add_pc ()
                % m_line_header->maximum_ops_per_instruction);
 }
 
-/* Return non-zero if we should add LINE to the line number table.
+/* Return true if we should add LINE to the line number table.
    LINE is the line to add, LAST_LINE is the last line that was added,
    LAST_SUBFILE is the subfile for LAST_LINE.
    LINE_HAS_NON_ZERO_DISCRIMINATOR is non-zero if LINE has ever
@@ -291,22 +291,22 @@ lnp_state_machine::handle_const_add_pc ()
    Note: Addresses in the line number state machine can never go backwards
    within one sequence, thus this coalescing is ok.  */
 
-static int
+static bool
 dwarf_record_line_p (struct dwarf2_cu *cu,
                     unsigned int line, unsigned int last_line,
                     int line_has_non_zero_discriminator,
                     struct subfile *last_subfile)
 {
   if (cu->get_builder ()->get_current_subfile () != last_subfile)
-    return 1;
+    return true;
   if (line != last_line)
-    return 1;
+    return true;
   /* Same line for the same file that we've seen already.
      As a last check, for pr 17276, only record the line if the line
      has never had a non-zero discriminator.  */
   if (!line_has_non_zero_discriminator)
-    return 1;
-  return 0;
+    return true;
+  return false;
 }
 
 /* Use the CU's builder to record line number LINE beginning at
@@ -706,7 +706,7 @@ dwarf_decode_lines_1 (struct line_header *lh, struct dwarf2_cu *cu,
 
 void
 dwarf_decode_lines (struct line_header *lh, struct dwarf2_cu *cu,
-                   unrelocated_addr lowpc, int decode_mapping)
+                   unrelocated_addr lowpc, bool decode_mapping)
 {
   if (decode_mapping)
     dwarf_decode_lines_1 (lh, cu, lowpc);
index c84403253e635225d7c27d49a91dd1581fa0fa2e..824f18f9613c55a714d1889666ad25045ba1dba8 100644 (file)
@@ -42,6 +42,6 @@
 
 extern void dwarf_decode_lines (struct line_header *lh,
                                struct dwarf2_cu *cu,
-                               unrelocated_addr lowpc, int decode_mapping);
+                               unrelocated_addr lowpc, bool decode_mapping);
 
 #endif /* GDB_DWARF2_LINE_PROGRAM_H */