From: "Guillermo E. Martinez" <guillermo.e.martinez@oracle.com>
To: libabigail@sourceware.org
Subject: [PATCH 1/3] ctf-reader: Use argument by reference reading the context
Date: Wed, 17 Nov 2021 20:56:04 -0600 [thread overview]
Message-ID: <20211118025606.554809-2-guillermo.e.martinez@oracle.com> (raw)
In-Reply-To: <20211118025606.554809-1-guillermo.e.martinez@oracle.com>
* src/abg-ctf-reader.cc (read_context): Use const argument
pass by reference.
(create_read_context): Likewise.
---
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
{
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);
} // 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 = elf_path;
@@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
/// @param env a libabigail IR environment.
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);
}
--
2.33.0
next prev parent reply other threads:[~2021-11-18 2:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 2:56 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
2021-11-18 2:56 ` Guillermo E. Martinez [this message]
2021-11-18 17:26 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Dodji Seketeli
2021-11-18 23:09 ` Guillermo Martinez
2021-11-18 23:23 ` [PATCH v2 0/3] Some improvements in ctf-reader Guillermo E. Martinez
2021-11-18 23:23 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
2021-11-23 14:26 ` Dodji Seketeli
2021-11-18 23:23 ` [PATCH 2/3] ctf-reader: Use smart pointers in create_read_context Guillermo E. Martinez
2021-11-23 14:35 ` Dodji Seketeli
2021-11-23 15:42 ` Guillermo Martinez
2021-11-18 23:23 ` [PATCH 3/3] ctf-reader: Use ABG_ASSERT instead of assert Guillermo E. Martinez
2021-11-23 14:51 ` Dodji Seketeli
2021-11-18 3:01 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
2021-11-18 3:01 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211118025606.554809-2-guillermo.e.martinez@oracle.com \
--to=guillermo.e.martinez@oracle.com \
--cc=libabigail@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).