public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "Giuliano Procida via libabigail" <libabigail@sourceware.org>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com
Subject: [PATCH] Correct various inconsequential typos.
Date: Wed, 01 Jan 2020 00:00:00 -0000	[thread overview]
Message-ID: <20200305153431.86434-1-gprocida@google.com> (raw)

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 <gprocida@google.com>
---
 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)
-- 
2.25.0.265.gbab2e86ba0-goog

             reply	other threads:[~2020-03-05 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-01  0:00 Giuliano Procida via libabigail [this message]
2020-01-01  0:00 ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200305153431.86434-1-gprocida@google.com \
    --to=libabigail@sourceware.org \
    --cc=dodji@seketeli.org \
    --cc=gprocida@google.com \
    --cc=kernel-team@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).