From fc27ec48c9d63879e4b0f049060e943233cb540d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 17 Oct 2016 15:43:47 +0200 Subject: Cleanup match_result mess --- build2/cli/rule | 4 ++-- build2/cli/rule.cxx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/rule b/build2/cli/rule index 4f8ebc2..41ff8bf 100644 --- a/build2/cli/rule +++ b/build2/cli/rule @@ -18,10 +18,10 @@ namespace build2 { public: virtual match_result - match (action, target&, const string& hint) const; + match (action, target&, const string& hint) const override; virtual recipe - apply (action, target&, const match_result&) const; + apply (action, target&) const override; static target_state perform_update (action, target&); diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index cec8a60..bcc3a9f 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -56,7 +56,7 @@ namespace build2 // See if we have a .cli source file. // - match_result r; + bool r (false); for (prerequisite_member p: group_prerequisite_members (a, t)) { if (p.is_a ()) @@ -67,10 +67,10 @@ namespace build2 { l4 ([&]{trace << ".cli file stem '" << p.name () << "' " << "doesn't match target " << t;}); - return r; + return false; } - r = p; + r = true; break; } } @@ -113,7 +113,7 @@ namespace build2 // it is some other group, then we are definitely not a match. // if (t.group != nullptr) - return t.group->is_a (); + return t.group->is_a () != nullptr; // Check if there is a corresponding cli.cxx{} group. // @@ -164,12 +164,12 @@ namespace build2 } assert (t.group == g); - return g; + return g != nullptr; } } recipe compile:: - apply (action a, target& xt, const match_result& mr) const + apply (action a, target& xt) const { if (cli_cxx* pt = xt.is_a ()) { @@ -199,7 +199,7 @@ namespace build2 } else { - cli_cxx& g (*static_cast (mr.target)); + cli_cxx& g (*static_cast (xt.group)); build2::match (a, g); return group_recipe; // Execute the group's recipe. } -- cgit v1.1