aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-27 13:00:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-04-27 13:00:15 +0200
commit68cc1badd2eb96fd1f89e8b6519d45039ff983ba (patch)
treeed72296e9f2eb5312b3b94a8318961cab14e6f4f
parent9e5750ae2e3f837f80860aaab6b01e4d556213ed (diff)
Get rid of warnings
-rw-r--r--libbuild2/file.cxx2
-rw-r--r--libbuild2/target.hxx23
-rw-r--r--libbuild2/target.ixx28
3 files changed, 32 insertions, 21 deletions
diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx
index fb24160..edb382c 100644
--- a/libbuild2/file.cxx
+++ b/libbuild2/file.cxx
@@ -1553,7 +1553,7 @@ namespace build2
// Process error, fall through.
}
- catch (const io_error& e)
+ catch (const io_error&)
{
// IO error (or process error), fall through.
}
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx
index 6edfe5c..8adaa2c 100644
--- a/libbuild2/target.hxx
+++ b/libbuild2/target.hxx
@@ -306,10 +306,7 @@ namespace build2
key () const;
names
- as_name () const
- {
- return key ().as_name ();
- }
+ as_name () const;
// Scoping.
//
@@ -1737,27 +1734,13 @@ namespace build2
// instead of the absolute one in diagnostics.
//
process_path_type
- process_path () const
- {
- // It's unfortunate we have to return by value but hopefully the
- // compiler will see through it. Note also that returning empty
- // process path if path is empty.
- //
- return process_path_.empty ()
- ? process_path_type (path ().string ().c_str (),
- path_type (),
- path_type ())
- : process_path_type (process_path_, false /* init */);
- }
+ process_path () const;
// Note that setting the custom process path is not MT-safe and must be
// done while holding the insertion lock.
//
void
- process_path (process_path_type p)
- {
- process_path_ = move (p);
- }
+ process_path (process_path_type);
public:
static const target_type static_type;
diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx
index 3842c37..5f53f3d 100644
--- a/libbuild2/target.ixx
+++ b/libbuild2/target.ixx
@@ -30,6 +30,12 @@ namespace build2
e != nullptr ? optional<string> (*e) : nullopt};
}
+ inline names target::
+ as_name () const
+ {
+ return key ().as_name ();
+ }
+
inline auto target::
prerequisites () const -> const prerequisites_type&
{
@@ -558,4 +564,26 @@ namespace build2
{
return mtime_target::load_mtime (path ());
}
+
+ // exe
+ //
+ inline auto exe::
+ process_path () const -> process_path_type
+ {
+ // It's unfortunate we have to return by value but hopefully the
+ // compiler will see through it. Note also that returning empty
+ // process path if path is empty.
+ //
+ return process_path_.empty ()
+ ? process_path_type (path ().string ().c_str (),
+ path_type (),
+ path_type ())
+ : process_path_type (process_path_, false /* init */);
+ }
+
+ inline void exe::
+ process_path (process_path_type p)
+ {
+ process_path_ = move (p);
+ }
}