Correct various inconsequential typos.
authorGiuliano Procida <gprocida@google.com>
Thu, 5 Mar 2020 15:34:31 +0000 (15:34 +0000)
committerDodji Seketeli <dodji@redhat.com>
Fri, 6 Mar 2020 13:24:08 +0000 (14:24 +0100)
In the leaf reporter member subtype changes are labelled as plain
changes and vice versa. This was probably due to the different
ordering of the code sections in the default and leaf reporters.
Output is unchanged as these tags currently map to the same strings.

When generating diff reports there were some rare cases where a
pretty representation might have been emitted twice or the trailing
whitespace might have been missing.

* src/abg-leaf-reporter.cc (report): In the class_or_union_diff
overoad, swap calls to report_mem_header to match the rest of the
code.
* src/abg-reporter-priv.cc (represent): In the var_diff_sptr
overload, add some missing whitespace; remember we've emitted the
pretty representation in 2 cases where this was omitted (though 1
of these is the last case where it makes no difference).
maybe_report_diff_for_symbol Add some missing whitespace; remember
we've reported a diff (and need a trailing newline) in 1 case
where this was omitted, also affecting the return value of the
function (but no caller cares).

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-leaf-reporter.cc
src/abg-reporter-priv.cc

index 791b301cd073face3d12dc2787ce98d0a53ea930..86a9ba2f4bfddfd4ce978cc0f98ded92e06a6dea 100644 (file)
@@ -647,7 +647,7 @@ leaf_reporter::report(const class_or_union_diff& d,
       bool emitted_data_members_changes = false;
       if (net_numchanges)
        {
-         report_mem_header(out, subtype_change_kind, "data member", indent);
+         report_mem_header(out, change_kind, "data member", indent);
          for (var_diff_sptrs_type::const_iterator it =
                 d.class_or_union_diff::get_priv()->
                 sorted_changed_dm_.begin();
@@ -676,7 +676,7 @@ leaf_reporter::report(const class_or_union_diff& d,
       if (net_numchanges)
        {
          if (!emitted_data_members_changes)
-           report_mem_header(out, change_kind, "data member", indent);
+           report_mem_header(out, subtype_change_kind, "data member", indent);
          for (var_diff_sptrs_type::const_iterator it =
                 d.class_or_union_diff::get_priv()->sorted_subtype_changed_dm_.begin();
               it != d.class_or_union_diff::get_priv()->sorted_subtype_changed_dm_.end();
index 29aa37cd847adcce305b26c844779ba6b414781b..fbac85f8d210532e49b6c4bc5bd673a03178cff5 100644 (file)
@@ -446,7 +446,7 @@ represent(const var_diff_sptr       &diff,
              << indent << "to:\n"
              << indent << " " << get_type_name(n->get_type()) << "\n"
              << indent << " This is usually due to "
-             <<"an anonymous member type being added or removed from "
+             << "an anonymous member type being added or removed from "
              << "the containing type\n";
        }
     }
@@ -645,6 +645,7 @@ represent(const var_diff_sptr       &diff,
        out << ", ";
       out << "visibility changed from " << o->get_visibility()
          << " to " << n->get_visibility();
+      emitted = true;
     }
   if ((ctxt->get_allowed_category() & ACCESS_CHANGE_CATEGORY)
       && (get_member_access_specifier(o)
@@ -683,6 +684,7 @@ represent(const var_diff_sptr       &diff,
        out << "is no more static";
       else
        out << "now becomes static";
+      emitted = true;
     }
 }
 
@@ -1090,7 +1092,7 @@ maybe_report_diff_for_symbol(const elf_symbol_sptr&       symbol1,
 {
   bool reported = false;
 
-  if (!symbol1 ||!symbol2 || symbol1 == symbol2)
+  if (!symbol1 || !symbol2 || symbol1 == symbol2)
     return reported;
 
   if (symbol1->get_size() != symbol2->get_size())
@@ -1180,6 +1182,8 @@ maybe_report_diff_for_symbol(const elf_symbol_sptr&       symbol1,
       out << symbol1->get_version().str()
          << " to "
          << symbol2->get_version().str();
+
+      reported = true;
     }
 
   if (reported)