From patchwork Thu Mar 12 06:30:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39025 From: gprocida@google.com (Giuliano Procida) Date: Thu, 12 Mar 2020 06:30:33 +0000 Subject: [PATCH 2/5] abg-leaf-reporter.cc: Fix indentation of function parameter diffs. In-Reply-To: <20200312063036.29419-1-gprocida@google.com> References: <20200312063036.29419-1-gprocida@google.com> Message-ID: <20200312063036.29419-3-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 --- 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*'