public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Giuliano Procida <gprocida@google.com>
To: libabigail@sourceware.org
Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com
Subject: [PATCH 2/5] abg-leaf-reporter.cc: Fix indentation of function parameter diffs.
Date: Thu, 12 Mar 2020 06:30:33 +0000	[thread overview]
Message-ID: <20200312063036.29419-3-gprocida@google.com> (raw)
In-Reply-To: <20200312063036.29419-1-gprocida@google.com>

When reporting the details of changes to function parameter
differences in leaf-changes-only mode, the details are output at the
same level of indentation as the introductory text. In default mode
the usual 2-space indentation is used.

This patch fixes this discrepancy, making the output more readable.

	* src/abg-leaf-reporter.cc (report): In the fn_parm_diff
	override, indent the lines of detail by 2 spaces.
	* tests/data/test-abidiff-exit/test-leaf3-report.txt: Update
	report with correct indentation.

Signed-off-by: Giuliano Procida <gprocida@google.com>
---
 src/abg-leaf-reporter.cc                         |  2 +-
 .../data/test-abidiff-exit/test-leaf3-report.txt | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/abg-leaf-reporter.cc b/src/abg-leaf-reporter.cc
index 878e4125..bbd51dcb 100644
--- a/src/abg-leaf-reporter.cc
+++ b/src/abg-leaf-reporter.cc
@@ -250,7 +250,7 @@ leaf_reporter::report(const fn_parm_diff& d,
   out << " of type '"
       << f->get_type_pretty_representation()
       << "' changed:\n";
-  d.type_diff()->report(out, indent);
+  d.type_diff()->report(out, indent + "  ");
 }
 
 /// Report the changes carried by a @ref function_type_diff node.
diff --git a/tests/data/test-abidiff-exit/test-leaf3-report.txt b/tests/data/test-abidiff-exit/test-leaf3-report.txt
index d02c71a7..138c4b5a 100644
--- a/tests/data/test-abidiff-exit/test-leaf3-report.txt
+++ b/tests/data/test-abidiff-exit/test-leaf3-report.txt
@@ -7,23 +7,23 @@ Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable
 
   [C] 'function void fn1(sto1)' at test-leaf3-v1.c:10:1 has some sub-type changes:
     parameter 1 of type 'struct sto1' changed:
-    type name changed from 'sto1' to 'stn1'
-    type size hasn't changed
+      type name changed from 'sto1' to 'stn1'
+      type size hasn't changed
 
 
   [C] 'function void fn2(sto2)' at test-leaf3-v1.c:13:1 has some sub-type changes:
     parameter 1 of type 'struct sto2' changed:
-    type name changed from 'sto2' to 'stn2'
-    type size changed from 64 to 128 (in bits)
-    1 data member insertion:
-      'double stn2::y', at offset 64 (in bits) at test-leaf3-v1.c:7:1
+      type name changed from 'sto2' to 'stn2'
+      type size changed from 64 to 128 (in bits)
+      1 data member insertion:
+        'double stn2::y', at offset 64 (in bits) at test-leaf3-v1.c:7:1
 
   [C] 'function void fn3(sto1*)' at test-leaf3-v1.c:16:1 has some sub-type changes:
     parameter 1 of type 'sto1*' changed:
-    pointer type changed from: 'sto1*' to: 'stn1*'
+      pointer type changed from: 'sto1*' to: 'stn1*'
 
   [C] 'function void fn4(sto2*)' at test-leaf3-v1.c:19:1 has some sub-type changes:
     parameter 1 of type 'sto2*' changed:
-    pointer type changed from: 'sto2*' to: 'stn2*'
+      pointer type changed from: 'sto2*' to: 'stn2*'
 
 
-- 
2.25.1.481.gfbce0eb801-goog


  parent reply	other threads:[~2020-03-12  6:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12  6:30 [PATCH 0/5] More whitespace and leaf-changes-only fixes Giuliano Procida
2020-03-12  6:30 ` [PATCH 1/5] Fix interaction of --redundant and --leaf-changes-only options Giuliano Procida
2020-03-13 17:30   ` Dodji Seketeli
2020-03-12  6:30 ` Giuliano Procida [this message]
2020-03-13 17:37   ` [PATCH 2/5] abg-leaf-reporter.cc: Fix indentation of function parameter diffs Dodji Seketeli
2020-03-12  6:30 ` [PATCH 3/5] [abidiff] Eliminate some unnecessary blank lines in diff output Giuliano Procida
2020-03-14 20:09   ` Matthias Maennich
2020-03-16 10:51     ` Giuliano Procida
2020-03-16 12:29       ` Matthias Maennich
2020-03-16 13:04         ` Giuliano Procida
2020-03-16 13:44           ` Matthias Maennich
2020-03-16 14:32             ` Giuliano Procida
2020-03-16 13:10   ` [PATCH 3/5 v2] " Giuliano Procida
2020-03-16 16:10     ` Dodji Seketeli
2020-03-12  6:30 ` [PATCH 4/5] [abidiff] Output 2-space indentation consistently Giuliano Procida
2020-03-13 15:38   ` [PATCH 4/5 v2] " Giuliano Procida
2020-03-17 12:31     ` Dodji Seketeli
2020-03-14 20:12   ` [PATCH 4/5] " Matthias Maennich
2020-03-12  6:30 ` [PATCH 5/5] [abidiff] Treat function type changes as local Giuliano Procida
2020-03-14 20:45   ` Matthias Maennich
2020-03-17 16:15   ` 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=20200312063036.29419-3-gprocida@google.com \
    --to=gprocida@google.com \
    --cc=dodji@seketeli.org \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    /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).