From patchwork Wed Jan 1 00:00:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksei Vetrov via Libabigail X-Patchwork-Id: 38989 X-Patchwork-Original-From: libabigail@sourceware.org (Giuliano Procida via libabigail) From: Aleksei Vetrov via Libabigail Date: Wed, 01 Jan 2020 00:00:00 -0000 Subject: [PATCH] Correct various inconsequential typos. Message-ID: <20200305153431.86434-1-gprocida@google.com> 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(class_or_union_diff) Swap calls to report_mem_header to match the rest of the code. * src/abg-reporter-priv.cc: represent(var_diff_sptr) 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 --- src/abg-leaf-reporter.cc | 4 ++-- src/abg-reporter-priv.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/abg-leaf-reporter.cc b/src/abg-leaf-reporter.cc index 791b301c..86a9ba2f 100644 --- a/src/abg-leaf-reporter.cc +++ b/src/abg-leaf-reporter.cc @@ -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(); diff --git a/src/abg-reporter-priv.cc b/src/abg-reporter-priv.cc index 78ebd91b..2a0880bc 100644 --- a/src/abg-reporter-priv.cc +++ b/src/abg-reporter-priv.cc @@ -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)