From db2a696f810e41189bcdf5524696ff3d0cfbe5a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Feb 2017 11:40:07 +0200 Subject: Use target:as<> instead of static_cast for target casting --- build2/cli/rule | 2 ++ build2/cli/rule.cxx | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/rule b/build2/cli/rule index 1fbbde4..03fd471 100644 --- a/build2/cli/rule +++ b/build2/cli/rule @@ -14,6 +14,8 @@ namespace build2 { namespace cli { + // @@ Redo as two separate rules? + // class compile: public rule { public: diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index 5dcec99..7928c5c 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -199,7 +199,7 @@ namespace build2 } else { - cli_cxx& g (static_cast (*xt.group)); + cli_cxx& g (xt.group->as ()); build2::match (ml, a, g); return group_recipe; // Execute the group's recipe. } @@ -230,7 +230,7 @@ namespace build2 target_state compile:: perform_update (action a, const target& xt) { - const cli_cxx& t (static_cast (xt)); + const cli_cxx& t (xt.as ()); // Update prerequisites and determine if any relevant ones render us // out-of-date. Note that currently we treat all the prerequisites @@ -322,7 +322,7 @@ namespace build2 target_state compile:: perform_clean (action a, const target& xt) { - const cli_cxx& t (static_cast (xt)); + const cli_cxx& t (xt.as ()); // The reverse order of update: first delete the files, then clean // prerequisites. Also update timestamp in case there are operations -- cgit v1.1