From patchwork Thu May 25 19:44:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Woodard X-Patchwork-Id: 70100 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F48C3858D37 for ; Thu, 25 May 2023 19:44:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F48C3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1685043883; bh=58zLXE0juIvp+XjeCCQAIMLYkPr1w4cMAOD2x2L/7QA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Help:List-Subscribe:From:Reply-To:From; b=qvkHepXjpXUm49BVLOyAIZkm7rz02yMBbbeufbBobMluByctwQ7LwUodXcVp9pxTS JK+oqmvlImmA2WPkMNSrJ9EhjwFSp+80UPDMRkL36HA8vaj3Nr+Rt9+eBn+DKU36Wl 0b+Y9Pzu7BSoh74B5HlNvYQkkT0O7FHyq7ddxOWs= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 652003858D32 for ; Thu, 25 May 2023 19:44:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 652003858D32 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-Q6Re6DIfMGWHSEHtc27lfA-1; Thu, 25 May 2023 15:44:35 -0400 X-MC-Unique: Q6Re6DIfMGWHSEHtc27lfA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-623a303a27eso1956806d6.3 for ; Thu, 25 May 2023 12:44:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685043875; x=1687635875; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=58zLXE0juIvp+XjeCCQAIMLYkPr1w4cMAOD2x2L/7QA=; b=Cl5KyMRa/djscq7j3+n8HNZPr5sIcdBkMP7sKFYmxNXUuIrMiTRhLHpit3y4VGXct7 E5cHvId8vriU8veLUDTbJ+GveTu3L9C4eABQe836cbR65aduIsvR0FH/83shKZfTYOl/ EUpUZzFadVmbHwSk8nCN7qS/1e65hTmiYOjXhpUTw6vsEnnrYzJT6JWHU1WPUC13gHQn PZHMpoyr4M5OEJGC8kPfV67NSwNHgGTsSJ7ZsF4fmxjH9pldPOttmA61odR8ZfiGQYoh p4SPWlF0faaIPbQAKSJzdQKyLu4I2cxenb73BC4Khe99siyJgv7gHxGlp8A6kBP5+3Hq KHfw== X-Gm-Message-State: AC+VfDxYurQt2xT2rFUzIi4TuaGm6dbMRvodITAxPi5HzmaP9slSrWKH btNWUFDWKXFPq3I/D0iSnhr/O3aXqtcx9Ku6GWk5g0PsiS6xUJHoYbOhtZmMUtUYkS8ZTkqhVZo 2otTN39rK0DwAvgXLFnuHTE1zpeJYaEDYbhw+an8qYCfXGMtyKKJdLYqvafA1NS9yq2r84hyRgC dB9Do= X-Received: by 2002:ad4:5f08:0:b0:5ef:45a7:a3c0 with SMTP id fo8-20020ad45f08000000b005ef45a7a3c0mr3310537qvb.27.1685043874826; Thu, 25 May 2023 12:44:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6DJxR73Jao1A51QDHLrXgf0DCxSO+P7uio4h/wYsPn2K9PitbiHTng/TgUscjbZn00XML0xA== X-Received: by 2002:ad4:5f08:0:b0:5ef:45a7:a3c0 with SMTP id fo8-20020ad45f08000000b005ef45a7a3c0mr3310489qvb.27.1685043874293; Thu, 25 May 2023 12:44:34 -0700 (PDT) Received: from pun.redhat.com ([47.208.218.201]) by smtp.gmail.com with ESMTPSA id y20-20020ad457d4000000b006238c00c0eesm653257qvx.50.2023.05.25.12.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 12:44:33 -0700 (PDT) To: libabigail@sourceware.org Cc: Ben Woodard Subject: [PATCH] Tiny code reorgination Date: Thu, 25 May 2023 12:44:28 -0700 Message-Id: <20230525194428.888014-1-woodard@redhat.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Ben Woodard via Libabigail From: Ben Woodard Reply-To: Ben Woodard Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Make prepare_di_root_paths a member function of the options class. * tools/abidiff.cc make prepare_di_root_paths a member function * tools/abidw.cc make prepare_di_root_paths a member function Signed-off-by: Ben Woodard --- tools/abidiff.cc | 28 ++++++++++++---------------- tools/abidw.cc | 21 ++++++++------------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/tools/abidiff.cc b/tools/abidiff.cc index 0e6538eb..dfc6f528 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -208,6 +208,17 @@ struct options prepared_di_root_paths1.clear(); prepared_di_root_paths2.clear(); } + + /// Convert di_root_paths{1,2} into prepared_di_root_paths{1,2} + /// which is the suitable type format that the dwarf_reader expects. + void prepare_di_root_paths() + { + abigail::tools_utils::convert_char_stars_to_char_star_stars + (this->di_root_paths1, this->prepared_di_root_paths1); + + abigail::tools_utils::convert_char_stars_to_char_star_stars + (this->di_root_paths2, this->prepared_di_root_paths2); + } };//end struct options; static void @@ -997,21 +1008,6 @@ adjust_diff_context_for_kmidiff(diff_context &ctxt) ctxt.show_linkage_names(false); } -/// Convert options::di_root_paths{1,2} into -/// options::prepared_di_root_paths{1,2} which is the suitable type -/// format that the dwarf_reader expects. -/// -/// @param o the options to consider. -static void -prepare_di_root_paths(options& o) -{ - abigail::tools_utils::convert_char_stars_to_char_star_stars - (o.di_root_paths1, o.prepared_di_root_paths1); - - abigail::tools_utils::convert_char_stars_to_char_star_stars - (o.di_root_paths2, o.prepared_di_root_paths2); -} - /// Emit an appropriate error message if necessary, given an error /// code. /// @@ -1194,7 +1190,7 @@ main(int argc, char* argv[]) return 0; } - prepare_di_root_paths(opts); + opts.prepare_di_root_paths(); if (!maybe_check_suppression_files(opts)) return (abigail::tools_utils::ABIDIFF_USAGE_ERROR diff --git a/tools/abidw.cc b/tools/abidw.cc index eead7889..a17ec8b1 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -181,6 +181,13 @@ struct options prepared_di_root_paths.clear(); } + /// Convert di_root_paths into prepared_di_root_paths + /// which is the suitable type format that the dwarf_reader expects. + void prepare_di_root_paths() + { + tools_utils::convert_char_stars_to_char_star_stars(this->di_root_paths, + this->prepared_di_root_paths); + } }; static void @@ -955,18 +962,6 @@ load_kernel_corpus_group_and_write_abixml(char* argv[], return exit_code; } -/// Convert options::di_root_paths into -/// options::prepared_di_root_paths which is the suitable type format -/// that the dwarf_reader expects. -/// -/// @param o the options to consider. -static void -prepare_di_root_paths(options& o) -{ - tools_utils::convert_char_stars_to_char_star_stars(o.di_root_paths, - o.prepared_di_root_paths); -} - int main(int argc, char* argv[]) { @@ -1012,7 +1007,7 @@ main(int argc, char* argv[]) return 1; } - prepare_di_root_paths(opts); + opts.prepare_di_root_paths(); if (!maybe_check_suppression_files(opts)) return 1;