From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3HddpXggKCmwQZbYMSNKQYYQVO.MYWVSLKLSQKSVcYebMOgKbO.YbQ@flex--gprocida.bounces.google.com> Received: from mail-wm1-x349.google.com (mail-wm1-x349.google.com [IPv6:2a00:1450:4864:20::349]) by sourceware.org (Postfix) with ESMTPS id 9F06D393743E for ; Thu, 12 Mar 2020 06:30:54 +0000 (GMT) Received: by mail-wm1-x349.google.com with SMTP id x7so1444670wmi.4 for ; Wed, 11 Mar 2020 23:30:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=fwSCUp0jd952OcGeEZGu8MpuljJQSIbTIH83486PKgA=; b=MezDIRPIJCO+zc8PUvQmqFHtMky1kfCSEn762TmAPP0QtzCCYgIOcVKCk1OyluraOM d/Pd53u7NTSjnXXjmY8bszgeJMcTdFtvZU20k39vBZiibkzG3rH61haPMnK2RfqsgNRB k5v94kRrXw15KVrhewY7iyCianmlENtfytN0NUfXJD/nqKVVmb4UnxvqIEQl8eIpyTPb YN1r3FXjzZ2w4/cXF5aTJaeRaDNtn6/EH2cCC8bW0hGIxPj54V1SyeRTN9/Dg38axa/P bbxxnm4ptPYg8foag3FD6Noq7YJjVtQTjT05prYcOsqxaxuk9I7P/eRpWYT5pMXjwfyH xf/g== X-Gm-Message-State: ANhLgQ0JZ4g8j69B0WeyRP+Cp8JBfVd0KcOD/om60YyI77J/QZIV2Bvx Lrze0Ut9lr8JZDxT0fHMw3bJ3YGAbCCchxnmU9Mkyoj0GtZXy0fdfQj6lRGkoJwVfqiJwpxA6TW 4RMaGxBnLeyEmkgL2z1ZHYz2fMA0aQCGe+RsrOtsQr7n8y4QRz8ZHIVd+4wmRcW8IbIvynvE= X-Google-Smtp-Source: ADFU+vtaSZjB3GtbcMwHTRAbhY9mtxYkJBelb8kIrxT3pM3bCnE4RsEe8ndj6o2h4KnbCtYRHxt+i12bmSCryA== X-Received: by 2002:a5d:4dc2:: with SMTP id f2mr8948919wru.293.1583994653188; Wed, 11 Mar 2020 23:30:53 -0700 (PDT) Date: Thu, 12 Mar 2020 06:30:33 +0000 In-Reply-To: <20200312063036.29419-1-gprocida@google.com> Message-Id: <20200312063036.29419-3-gprocida@google.com> Mime-Version: 1.0 References: <20200312063036.29419-1-gprocida@google.com> X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog Subject: [PATCH 2/5] abg-leaf-reporter.cc: Fix indentation of function parameter diffs. From: Giuliano Procida To: libabigail@sourceware.org Cc: dodji@seketeli.org, kernel-team@android.com, gprocida@google.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-34.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2020 06:31:02 -0000 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*' -- 2.25.1.481.gfbce0eb801-goog