abg-leaf-reporter.cc: Fix indentation of function parameter diffs.

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>
This commit is contained in:
Giuliano Procida 2020-03-12 06:30:33 +00:00 committed by Dodji Seketeli
parent dcba808257
commit 28af7232c2
2 changed files with 9 additions and 9 deletions

View File

@ -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.

View File

@ -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*'