diff mbox series

[2/7] abidiff: Remove blank line after base class diffs.

Message ID 20200327140017.1917-3-gprocida@google.com
State Committed
Headers show
Series Mostly whitespace changes and fixes. | expand

Commit Message

Giuliano Procida March 27, 2020, 2 p.m. UTC
This patch removes the blank line emitted after base class diffs.
These are jarring, particularly when the diffs are nested.

	* src/abg-default-reporter.cc (report): In the class_diff
	overload, eliminate the extra blank line after base class
	changes and remove unneeded new line logic.
	* tests/data/test*report*.txt: Remove blank lines after base
	class diffs in 9 files.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-default-reporter.cc                            | 10 +---------
 tests/data/test-abidiff/test-PR18791-report0.txt       |  4 ----
 tests/data/test-diff-dwarf/test0-report.txt            |  1 -
 .../test-diff-dwarf/test27-local-base-diff-report.txt  |  1 -
 tests/data/test-diff-dwarf/test8-report.txt            |  1 -
 tests/data/test-diff-filter/test0-report.txt           |  1 -
 tests/data/test-diff-filter/test01-report.txt          |  1 -
 .../test29-finer-redundancy-marking-report-0.txt       |  1 -
 ...libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt |  3 ---
 ...x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt |  1 -
 10 files changed, 1 insertion(+), 23 deletions(-)
diff mbox series

Patch

diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc
index e2f520fd..b67fe259 100644
--- a/src/abg-default-reporter.cc
+++ b/src/abg-default-reporter.cc
@@ -1338,7 +1338,6 @@  default_reporter::report(const class_diff& d, ostream& out,
 	}
 
       // Report changes.
-      bool emitted = false;
       size_t num_filtered = d.get_priv()->count_filtered_bases();
       if (numchanges)
 	{
@@ -1359,10 +1358,7 @@  default_reporter::report(const class_diff& d, ostream& out,
 	      report_loc_info(o->get_base_class(), *d.context(), out);
 	      out << " changed:\n";
 	      diff->report(out, indent + "    ");
-	      emitted = true;
 	    }
-	  if (emitted)
-	    out << "\n";
 	}
 
       //Report insertions.
@@ -1372,20 +1368,16 @@  default_reporter::report(const class_diff& d, ostream& out,
 	  report_mem_header(out, numins, 0, ins_kind,
 			    "base class", indent);
 
-	  bool emitted = false;
 	  for (class_decl::base_specs::const_iterator i =
 		 d.get_priv()->sorted_inserted_bases_.begin();
 	       i != d.get_priv()->sorted_inserted_bases_.end();
 	       ++i)
 	    {
 	      class_decl_sptr b = (*i)->get_base_class();
-	      if (emitted)
-		out << "\n";
 	      out << indent << "  " << b->get_pretty_representation();
 	      report_loc_info(b, *ctxt, out);
-	      emitted = true;
+	      out << "\n";
 	    }
-	  out << "\n";
 	}
     }
 
diff --git a/tests/data/test-abidiff/test-PR18791-report0.txt b/tests/data/test-abidiff/test-PR18791-report0.txt
index 3c26de12..87322587 100644
--- a/tests/data/test-abidiff/test-PR18791-report0.txt
+++ b/tests/data/test-abidiff/test-PR18791-report0.txt
@@ -53,10 +53,8 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
                                               'unsigned long int std::_List_node<long unsigned int>::_M_data', at offset 128 (in bits)
                                           and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node'
                                       and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl'
-
                             'bool sigc::internal::trackable_callback_list::clearing_' offset changed from 128 to 192 (in bits) (by +64 bits)
 
-
   [C] 'method sigc::connection& sigc::connection::operator=(const sigc::connection&)' has some indirect sub-type changes:
     return type changed:
       in referenced type 'struct sigc::connection':
@@ -131,7 +129,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
                       and name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node'
                   and name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl'
 
-
   [C] 'method sigc::signal_base::iterator_type sigc::signal_base::insert(sigc::signal_base::iterator_type, const sigc::slot_base&)' has some indirect sub-type changes:
     return type changed:
       underlying type 'typedef sigc::internal::signal_impl::iterator_type' changed, as reported earlier
@@ -148,7 +145,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
         1 base class change:
           'struct sigc::trackable' changed:
             details were reported earlier
-
         1 data member change:
           type of 'sigc::internal::signal_impl* sigc::signal_base::impl_' changed:
             pointed to type 'struct sigc::internal::signal_impl' changed, as reported earlier
diff --git a/tests/data/test-diff-dwarf/test0-report.txt b/tests/data/test-diff-dwarf/test0-report.txt
index 05cc3bdf..d8a213a5 100644
--- a/tests/data/test-diff-dwarf/test0-report.txt
+++ b/tests/data/test-diff-dwarf/test0-report.txt
@@ -16,7 +16,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
             type size changed from 64 to 96 (in bits)
             1 data member insertion:
               'unsigned int B0S0::m2', at offset 64 (in bits)
-
         1 data member change:
           'int S0::m0' offset changed from 64 to 96 (in bits) (by +32 bits), access changed from 'private' to 'protected'
 
diff --git a/tests/data/test-diff-dwarf/test27-local-base-diff-report.txt b/tests/data/test-diff-dwarf/test27-local-base-diff-report.txt
index 050afd22..a2db4e9e 100644
--- a/tests/data/test-diff-dwarf/test27-local-base-diff-report.txt
+++ b/tests/data/test-diff-dwarf/test27-local-base-diff-report.txt
@@ -17,7 +17,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
         1 base class change:
           'struct base' changed:
             details were reported earlier
-
         1 data member change:
           'int S::m0' offset changed from 32 to 64 (in bits) (by +32 bits)
 
diff --git a/tests/data/test-diff-dwarf/test8-report.txt b/tests/data/test-diff-dwarf/test8-report.txt
index ee185dbf..59834a5a 100644
--- a/tests/data/test-diff-dwarf/test8-report.txt
+++ b/tests/data/test-diff-dwarf/test8-report.txt
@@ -16,7 +16,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
             type size hasn't changed
             1 data member change:
               'char B0::m0' access changed from 'public' to 'private'
-
         1 base class insertion:
           class B1
         1 data member change:
diff --git a/tests/data/test-diff-filter/test0-report.txt b/tests/data/test-diff-filter/test0-report.txt
index 1dc19ed9..afa87571 100644
--- a/tests/data/test-diff-filter/test0-report.txt
+++ b/tests/data/test-diff-filter/test0-report.txt
@@ -18,7 +18,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
               'unsigned int B0S0::m2', at offset 32 (in bits)
             1 data member change:
               'char B0S0::m1' offset changed from 32 to 64 (in bits) (by +32 bits)
-
         1 data member change:
           'int S0::m0' offset changed from 64 to 96 (in bits) (by +32 bits)
 
diff --git a/tests/data/test-diff-filter/test01-report.txt b/tests/data/test-diff-filter/test01-report.txt
index 8c08ddb9..73b907e5 100644
--- a/tests/data/test-diff-filter/test01-report.txt
+++ b/tests/data/test-diff-filter/test01-report.txt
@@ -18,7 +18,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
               'unsigned int B0S0::m2', at offset 32 (in bits)
             1 data member change:
               'char B0S0::m1' offset changed from 32 to 64 (in bits) (by +32 bits)
-
         1 data member change:
           'int S0::m0' offset changed from 64 to 96 (in bits) (by +32 bits), access changed from 'private' to 'protected'
 
diff --git a/tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt b/tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt
index 2cb2c362..dd8b6b01 100644
--- a/tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt
+++ b/tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt
@@ -21,7 +21,6 @@  Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
         1 base class change:
           'struct base' changed:
             details were reported earlier
-
         1 data member change:
           'int inherited::m0' offset changed from 32 to 64 (in bits) (by +32 bits)
 
diff --git a/tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt b/tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt
index 9f22d5f5..b1611303 100644
--- a/tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt
+++ b/tests/data/test-diff-pkg/libsigc++-2.0-0c2a_2.4.0-1_amd64--libsigc++-2.0-0v5_2.4.1-1ubuntu2_amd64-report-0.txt
@@ -59,10 +59,8 @@ 
                                                         'unsigned long int std::_List_node<long unsigned int>::_M_data', at offset 128 (in bits)
                                                     and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_List_impl::_M_node'
                                                 and name of 'std::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::internal::trackable_callback, std::allocator<sigc::internal::trackable_callback> >::_M_impl'
-
                                       'bool sigc::internal::trackable_callback_list::clearing_' offset changed from 128 to 192 (in bits) (by +64 bits)
 
-
     [C] 'method sigc::internal::signal_impl* sigc::signal_base::impl() const' has some indirect sub-type changes:
       return type changed:
         in pointed to type 'struct sigc::internal::signal_impl':
@@ -83,6 +81,5 @@ 
                         name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_List_impl::_M_node'
                     and name of 'std::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl' changed to 'std::__cxx11::_List_base<sigc::slot_base, std::allocator<sigc::slot_base> >::_M_impl'
 
-
 ================ end of changes of 'libsigc-2.0.so.0.0.0'===============
 
diff --git a/tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt b/tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt
index 5aa8483d..ced0499d 100644
--- a/tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt
+++ b/tests/data/test-diff-pkg/tbb-4.1-9.20130314.fc22.x86_64--tbb-4.3-3.20141204.fc23.x86_64-report-0.txt
@@ -118,7 +118,6 @@ 
                                 struct tbb::internal::padded<tbb::internal::unpadded_mail_outbox, 128ul> at tbb_stddef.h:251:1
                               1 data member deletion:
                                 'char tbb::internal::mail_outbox::pad[104]', at offset 136 (in bits) at mailbox.h:114:1
-
                 1 member function deletion:
                   'method virtual tbb::task* tbb::internal::generic_scheduler::receive_or_steal_task(tbb::internal::reference_count&, bool)' at scheduler.h:391:1, virtual at voffset 7/7