aboutsummaryrefslogtreecommitdiff
path: root/build2/install/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-07 11:40:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commitdb2a696f810e41189bcdf5524696ff3d0cfbe5a9 (patch)
tree754c198967576ce9c9bdb9b07fdb90ad05b0d8d3 /build2/install/rule.cxx
parentbcfcc38538af8bb896551c9e5730767807ad7a67 (diff)
Use target:as<> instead of static_cast for target casting
Diffstat (limited to 'build2/install/rule.cxx')
-rw-r--r--build2/install/rule.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/build2/install/rule.cxx b/build2/install/rule.cxx
index 3be7eef..3a5bd3d 100644
--- a/build2/install/rule.cxx
+++ b/build2/install/rule.cxx
@@ -614,7 +614,7 @@ namespace build2
target_state file_rule::
perform_install (action a, const target& xt) const
{
- const file& t (static_cast<const file&> (xt));
+ const file& t (xt.as<file> ());
assert (!t.path ().empty ()); // Should have been assigned by update.
auto install_target = [this] (const file& t, const path& p, bool verbose)
@@ -663,7 +663,7 @@ namespace build2
for (const target* m (t.member); m != nullptr; m = m->member)
{
if (const path* p = lookup_install<path> (*m, "install"))
- install_target (static_cast<const file&> (*m), *p, false);
+ install_target (m->as<file> (), *p, false);
}
// Finally install the target itself (since we got here we know the
@@ -872,7 +872,7 @@ namespace build2
target_state file_rule::
perform_uninstall (action a, const target& xt) const
{
- const file& t (static_cast<const file&> (xt));
+ const file& t (xt.as<file> ());
assert (!t.path ().empty ()); // Should have been assigned by update.
auto uninstall_target = [this] (
@@ -930,9 +930,8 @@ namespace build2
for (const target* m (t.member); m != nullptr; m = m->member)
{
if (const path* p = lookup_install<path> (*m, "install"))
- r |= uninstall_target (static_cast<const file&> (*m),
- *p,
- r != target_state::changed);
+ r |= uninstall_target (
+ m->as<file> (), *p, r != target_state::changed);
}
// Finally handle installable prerequisites.