abg-comparison.cc: Tidy some corpus_diff code

Message ID 20200701105426.2496866-1-gprocida@google.com
State Committed, archived
Headers
Series abg-comparison.cc: Tidy some corpus_diff code |

Commit Message

Giuliano Procida July 1, 2020, 10:54 a.m. UTC
  This commit fixes up some code whitespace for style and consitency,
renames a poorly-named variable and fixes a comment typo.

There are no behavioural changes.

	* src/abg-comparison.cc (corpus_diff::priv::emit_diff_stats):
	Adjust code whitespace; rename the second instance of
	total_nb_variable_changes to
	total_nb_unreachable_type_changes.
	(corpus_diff::has_incompatible_changes): Fix comment typo.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-comparison.cc | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
  

Comments

Matthias Männich July 10, 2020, 4:02 p.m. UTC | #1
On Wed, Jul 01, 2020 at 11:54:26AM +0100, Android Kernel Team wrote:
>This commit fixes up some code whitespace for style and consitency,
>renames a poorly-named variable and fixes a comment typo.
>
>There are no behavioural changes.
>
>	* src/abg-comparison.cc (corpus_diff::priv::emit_diff_stats):
>	Adjust code whitespace; rename the second instance of
>	total_nb_variable_changes to
>	total_nb_unreachable_type_changes.
>	(corpus_diff::has_incompatible_changes): Fix comment typo.
>
>Signed-off-by: Giuliano Procida <gprocida@google.com>

Reviewed-by: Matthias Maennich <maennich@google.com>

Cheers,
Matthias

>---
> src/abg-comparison.cc | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
>diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc
>index 88f0bdeb..e4b86426 100644
>--- a/src/abg-comparison.cc
>+++ b/src/abg-comparison.cc
>@@ -10099,7 +10099,6 @@ corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
> 	out << " (" << num_filtered << " filtered out)";
>       out << "\n";
>
>-
>       out << indent << "Changed leaf types summary: "
> 	  << s.net_num_leaf_type_changes();
>       if (s.num_leaf_type_changes_filtered_out())
>@@ -10137,7 +10136,6 @@ corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
>
>       // variables changes summary
>       out << indent << "Removed/Changed/Added variables summary: ";
>-
>       out << s.net_num_vars_removed() << " Removed";
>       if (s.num_removed_vars_filtered_out())
> 	out << " (" << s.num_removed_vars_filtered_out()
>@@ -10180,7 +10178,7 @@ corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
> 	out << " (" << s.num_changed_func_filtered_out() << " filtered out)";
>       out << ", ";
>
>-      out << s.net_num_func_added()<< " Added";
>+      out << s.net_num_func_added() << " Added";
>       if (s.num_added_func_filtered_out())
> 	out << " (" << s.num_added_func_filtered_out() << " filtered out)";
>       if (total_nb_function_changes <= 1)
>@@ -10194,7 +10192,6 @@ corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
> 	+ s.num_vars_changed() + s.num_vars_added();
>
>       out << indent << "Variables changes summary: ";
>-
>       out << s.net_num_vars_removed() << " Removed";
>       if (s.num_removed_vars_filtered_out())
> 	out << " (" << s.num_removed_vars_filtered_out()
>@@ -10221,7 +10218,7 @@ corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
>   // functions/variables.
>   if (ctxt->show_unreachable_types())
>     {
>-      size_t total_nb_variable_changes =
>+      size_t total_nb_unreachable_type_changes =
> 	s.num_removed_unreachable_types()
> 	+ s.num_changed_unreachable_types()
> 	+ s.num_added_unreachable_types();
>@@ -10247,7 +10244,7 @@ corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
>       if (s.num_added_unreachable_types_filtered_out())
> 	out << " (" << s.num_added_unreachable_types_filtered_out()
> 	    << " filtered out)";
>-      if (total_nb_variable_changes <= 1)
>+      if (total_nb_unreachable_type_changes <= 1)
> 	out << " type";
>       else
> 	out << " types";
>@@ -10808,7 +10805,7 @@ corpus_diff::has_incompatible_changes() const
> 	  || stats.net_num_func_removed() != 0
> 	  || (stats.num_func_with_virtual_offset_changes() != 0
> 	      // If all reports about functions with sub-type changes
>-	      // have been suppressd, then even those about functions
>+	      // have been suppressed, then even those about functions
> 	      // that are virtual don't matter anymore because the
> 	      // user willingly requested to shut them down
> 	      && stats.net_num_func_changed() != 0)
>-- 
>2.27.0.212.ge8ba1cc988-goog
>
>-- 
>To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>
  
Dodji Seketeli July 27, 2020, 9:59 a.m. UTC | #2
Giuliano Procida <gprocida@google.com> a écrit:

> This commit fixes up some code whitespace for style and consitency,
> renames a poorly-named variable and fixes a comment typo.
>
> There are no behavioural changes.
>
> 	* src/abg-comparison.cc (corpus_diff::priv::emit_diff_stats):
> 	Adjust code whitespace; rename the second instance of
> 	total_nb_variable_changes to
> 	total_nb_unreachable_type_changes.
> 	(corpus_diff::has_incompatible_changes): Fix comment typo.
>
> Signed-off-by: Giuliano Procida <gprocida@google.com>

Applied to master, thanks!

Cheers,
  

Patch

diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc
index 88f0bdeb..e4b86426 100644
--- a/src/abg-comparison.cc
+++ b/src/abg-comparison.cc
@@ -10099,7 +10099,6 @@  corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
 	out << " (" << num_filtered << " filtered out)";
       out << "\n";
 
-
       out << indent << "Changed leaf types summary: "
 	  << s.net_num_leaf_type_changes();
       if (s.num_leaf_type_changes_filtered_out())
@@ -10137,7 +10136,6 @@  corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
 
       // variables changes summary
       out << indent << "Removed/Changed/Added variables summary: ";
-
       out << s.net_num_vars_removed() << " Removed";
       if (s.num_removed_vars_filtered_out())
 	out << " (" << s.num_removed_vars_filtered_out()
@@ -10180,7 +10178,7 @@  corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
 	out << " (" << s.num_changed_func_filtered_out() << " filtered out)";
       out << ", ";
 
-      out << s.net_num_func_added()<< " Added";
+      out << s.net_num_func_added() << " Added";
       if (s.num_added_func_filtered_out())
 	out << " (" << s.num_added_func_filtered_out() << " filtered out)";
       if (total_nb_function_changes <= 1)
@@ -10194,7 +10192,6 @@  corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
 	+ s.num_vars_changed() + s.num_vars_added();
 
       out << indent << "Variables changes summary: ";
-
       out << s.net_num_vars_removed() << " Removed";
       if (s.num_removed_vars_filtered_out())
 	out << " (" << s.num_removed_vars_filtered_out()
@@ -10221,7 +10218,7 @@  corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
   // functions/variables.
   if (ctxt->show_unreachable_types())
     {
-      size_t total_nb_variable_changes =
+      size_t total_nb_unreachable_type_changes =
 	s.num_removed_unreachable_types()
 	+ s.num_changed_unreachable_types()
 	+ s.num_added_unreachable_types();
@@ -10247,7 +10244,7 @@  corpus_diff::priv::emit_diff_stats(const diff_stats&	s,
       if (s.num_added_unreachable_types_filtered_out())
 	out << " (" << s.num_added_unreachable_types_filtered_out()
 	    << " filtered out)";
-      if (total_nb_variable_changes <= 1)
+      if (total_nb_unreachable_type_changes <= 1)
 	out << " type";
       else
 	out << " types";
@@ -10808,7 +10805,7 @@  corpus_diff::has_incompatible_changes() const
 	  || stats.net_num_func_removed() != 0
 	  || (stats.num_func_with_virtual_offset_changes() != 0
 	      // If all reports about functions with sub-type changes
-	      // have been suppressd, then even those about functions
+	      // have been suppressed, then even those about functions
 	      // that are virtual don't matter anymore because the
 	      // user willingly requested to shut them down
 	      && stats.net_num_func_changed() != 0)