From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by sourceware.org (Postfix) with ESMTPS id 8389E3858422 for ; Thu, 18 Nov 2021 17:26:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8389E3858422 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org Received: (Authenticated sender: dodji@seketeli.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 053A5200005; Thu, 18 Nov 2021 17:26:41 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 54398581C23; Thu, 18 Nov 2021 18:26:41 +0100 (CET) From: Dodji Seketeli To: "Guillermo E. Martinez via Libabigail" Subject: Re: [PATCH 1/3] ctf-reader: Use argument by reference reading the context Organization: Me, myself and I References: <20211118025606.554809-1-guillermo.e.martinez@oracle.com> <20211118025606.554809-2-guillermo.e.martinez@oracle.com> X-Operating-System: Fedora 36 X-URL: http://www.seketeli.net/~dodji Date: Thu, 18 Nov 2021 18:26:41 +0100 In-Reply-To: <20211118025606.554809-2-guillermo.e.martinez@oracle.com> (Guillermo E. Martinez via Libabigail's message of "Wed, 17 Nov 2021 20:56:04 -0600") Message-ID: <87v90p4bou.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Thu, 18 Nov 2021 17:26:46 -0000 Hello Guillermo, Thanks for your patch! I just have some small nits to pick. Please find my comments below: "Guillermo E. Martinez via Libabigail" a =C3=A9crit: > * src/abg-ctf-reader.cc (read_context): Use const argument > pass by reference. > (create_read_context): Likewise. Here each line should be prefixed by a "tab", as explained in the COMMIT-LOG-GUIDELINES file in the source tree at https://sourceware.org/git/?p=3Dlibabigail.git;a=3Dblob_plain;f=3DCOMMIT-LO= G-GUIDELINES;hb=3DHEAD. Also, there are some changes in the the file include/abg-ctf-reader.h. I added them to this ChangeLog part of the commit log. You'll find my updated version of your patch below. Would you please sign it off by adding a line starting by "Signed-off-by:" with your name and email, as explained in the file CONTRIBUTING at https://sourceware.org/git/?p=3Dlibabigail.git;a=3Dblob_plain;f=3DCONTRIBUT= ING;hb=3DHEAD ? I need that sign-off before committing the patch. Thanks a lot! >From ee0308d607b36fc4c5e3e4d815deb7ecf8884ad6 Mon Sep 17 00:00:00 2001 From: "Guillermo E. Martinez via Libabigail" Date: Wed, 17 Nov 2021 20:56:04 -0600 Subject: [PATCH] ctf-reader: Use argument by reference reading the context * include/abg-ctf-reader.h (create_read_context): Pass the string by reference. * src/abg-ctf-reader.cc (ctf_reader::read_context): Likewise. (create_read_context): Likewise. Signed-off-by: Dodji Seketeli --- include/abg-ctf-reader.h | 8 ++++---- src/abg-ctf-reader.cc | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h index c0d8bb2b..56b2bf91 100644 --- a/include/abg-ctf-reader.h +++ b/include/abg-ctf-reader.h @@ -25,10 +25,10 @@ namespace ctf_reader { =20 class read_context; -read_context *create_read_context (std::string elf_path, - ir::environment *env); -corpus_sptr read_corpus (read_context *ctxt, - elf_reader::status& status); +read_context *create_read_context(const std::string& elf_path, + ir::environment *env); +corpus_sptr read_corpus(read_context *ctxt, + elf_reader::status& status); =20 } // end namespace ctf_reader } // end namespace abigail diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc index 0370c8aa..2c2c204d 100644 --- a/src/abg-ctf-reader.cc +++ b/src/abg-ctf-reader.cc @@ -102,7 +102,7 @@ public: /// Constructor. /// /// @param elf_path the path to the ELF file. - read_context(string elf_path, ir::environment *env) + read_context(const string& elf_path, ir::environment *env) { types_map.clear(); filename =3D elf_path; @@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp) /// @param env a libabigail IR environment. =20 read_context * -create_read_context(std::string elf_path, ir::environment *env) +create_read_context(const std::string& elf_path, + ir::environment *env) { return new read_context(elf_path, env); } --=20 2.32.0 [...] Cheers, --=20 Dodji