aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-24 20:45:57 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-24 20:45:57 +0100
commit7b0100a955197d5905becc400e85b97710a2e7c8 (patch)
tree4956ab94a9144212869279763d350fe6d090f805
parentb3088c2915041463e9ff8fed77e33559bfc29683 (diff)
downloadpaludis-7b0100a955197d5905becc400e85b97710a2e7c8.tar.gz
paludis-7b0100a955197d5905becc400e85b97710a2e7c8.tar.xz
clean up
-rw-r--r--paludis/resolver/constraint.cc30
-rw-r--r--paludis/resolver/constraint.hh12
-rw-r--r--paludis/resolver/resolver.cc28
3 files changed, 32 insertions, 38 deletions
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index dc6187d..13c96bf 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.cc
@@ -38,16 +38,16 @@ namespace paludis
template <>
struct Implementation<Constraints>
{
- UseExisting strictest_use_existing_for_all;
- bool nothing_is_fine_too_for_all;
- bool all_untaken_for_all;
+ UseExisting strictest_use_existing;
+ bool nothing_is_fine_too;
+ bool all_untaken;
Sequence<std::tr1::shared_ptr<const Constraint> > constraints;
Implementation() :
- strictest_use_existing_for_all(static_cast<UseExisting>(last_ue - 1)),
- nothing_is_fine_too_for_all(true),
- all_untaken_for_all(true)
+ strictest_use_existing(static_cast<UseExisting>(last_ue - 1)),
+ nothing_is_fine_too(true),
+ all_untaken(true)
{
}
};
@@ -63,21 +63,21 @@ Constraints::~Constraints()
}
bool
-Constraints::all_untaken_for_all() const
+Constraints::all_untaken() const
{
- return _imp->all_untaken_for_all;
+ return _imp->all_untaken;
}
bool
-Constraints::nothing_is_fine_too_for_all() const
+Constraints::nothing_is_fine_too() const
{
- return _imp->nothing_is_fine_too_for_all;
+ return _imp->nothing_is_fine_too;
}
UseExisting
-Constraints::strictest_use_existing_for_all() const
+Constraints::strictest_use_existing() const
{
- return _imp->strictest_use_existing_for_all;
+ return _imp->strictest_use_existing;
}
Constraints::ConstIterator
@@ -96,9 +96,9 @@ void
Constraints::add(const std::tr1::shared_ptr<const Constraint> & c)
{
_imp->constraints.push_back(c);
- _imp->strictest_use_existing_for_all = std::min(_imp->strictest_use_existing_for_all, c->use_existing());
- _imp->nothing_is_fine_too_for_all = _imp->nothing_is_fine_too_for_all && c->nothing_is_fine_too();
- _imp->all_untaken_for_all = _imp->all_untaken_for_all && c->untaken();
+ _imp->strictest_use_existing = std::min(_imp->strictest_use_existing, c->use_existing());
+ _imp->nothing_is_fine_too = _imp->nothing_is_fine_too && c->nothing_is_fine_too();
+ _imp->all_untaken = _imp->all_untaken && c->untaken();
}
bool
diff --git a/paludis/resolver/constraint.hh b/paludis/resolver/constraint.hh
index c780181..f5a62a4 100644
--- a/paludis/resolver/constraint.hh
+++ b/paludis/resolver/constraint.hh
@@ -36,7 +36,6 @@ namespace paludis
namespace n
{
struct destination_type;
- struct for_slash;
struct nothing_is_fine_too;
struct reason;
struct spec;
@@ -68,14 +67,9 @@ namespace paludis
Constraints();
~Constraints();
- bool nothing_is_fine_too_for_all() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool nothing_is_fine_too_for(const DestinationType) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- bool all_untaken_for_all() const PALUDIS_ATTRIBUTE((warn_unused_result));
- bool all_untaken_for(const DestinationType) const PALUDIS_ATTRIBUTE((warn_unused_result));
-
- UseExisting strictest_use_existing_for_all() const PALUDIS_ATTRIBUTE((warn_unused_result));
- UseExisting strictest_use_existing_for(const DestinationType) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool nothing_is_fine_too() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ bool all_untaken() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ UseExisting strictest_use_existing() const PALUDIS_ATTRIBUTE((warn_unused_result));
void add(const std::tr1::shared_ptr<const Constraint> &);
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index a7a1222..782c538 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -145,7 +145,7 @@ Resolver::_resolve_decide_with_dependencies()
/* we're only being suggested. don't do this on the first pass, so
* we don't have to do restarts for suggestions later becoming hard
* deps. */
- if (state == deciding_non_suggestions && i->second->constraints()->all_untaken_for_all())
+ if (state == deciding_non_suggestions && i->second->constraints()->all_untaken())
continue;
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStepEvent());
@@ -1236,7 +1236,7 @@ Resolver::_try_to_find_decision_for(
const std::tr1::shared_ptr<const PackageID> installable_id(installable_id_best.first);
bool best(installable_id_best.second);
- if (resolution->constraints()->nothing_is_fine_too_for_all() && ! existing_id)
+ if (resolution->constraints()->nothing_is_fine_too() && ! existing_id)
{
/* nothing existing, but nothing's ok */
return make_shared_ptr(new Decision(make_named_values<Decision>(
@@ -1247,7 +1247,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(false),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_nothing_no_change),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
}
else if (installable_id && ! existing_id)
@@ -1261,7 +1261,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(false),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_changes_to_make),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
}
else if (existing_id && ! installable_id)
@@ -1269,7 +1269,7 @@ Resolver::_try_to_find_decision_for(
/* there's nothing installable. this may or may not be ok. */
bool is_transient(existing_id->transient_key() && existing_id->transient_key()->value());
- switch (resolution->constraints()->strictest_use_existing_for_all())
+ switch (resolution->constraints()->strictest_use_existing())
{
case ue_if_possible:
break;
@@ -1296,7 +1296,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(true),
value_for<n::is_transient>(is_transient),
value_for<n::kind>(dk_existing_no_change),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
}
@@ -1362,7 +1362,7 @@ Resolver::_try_to_find_decision_for(
bool is_transient(existing_id->transient_key() && existing_id->transient_key()->value());
/* we've got existing and installable. do we have any reason not to pick the existing id? */
- switch (resolution->constraints()->strictest_use_existing_for_all())
+ switch (resolution->constraints()->strictest_use_existing())
{
case ue_only_if_transient:
case ue_never:
@@ -1374,7 +1374,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(is_same_version),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_changes_to_make),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
case ue_if_same:
@@ -1387,7 +1387,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(is_same_version),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_existing_no_change),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
else
return make_shared_ptr(new Decision(make_named_values<Decision>(
@@ -1398,7 +1398,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(is_same_version),
value_for<n::is_transient>(is_transient),
value_for<n::kind>(dk_changes_to_make),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
case ue_if_same_version:
@@ -1411,7 +1411,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(is_same_version),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_existing_no_change),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
else
return make_shared_ptr(new Decision(make_named_values<Decision>(
@@ -1422,7 +1422,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(is_same_version),
value_for<n::is_transient>(is_transient),
value_for<n::kind>(dk_changes_to_make),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
case ue_if_possible:
@@ -1434,7 +1434,7 @@ Resolver::_try_to_find_decision_for(
value_for<n::is_same_version>(is_same_version),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_existing_no_change),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
case last_ue:
@@ -1458,7 +1458,7 @@ Resolver::_cannot_decide_for(
value_for<n::is_same_version>(false),
value_for<n::is_transient>(false),
value_for<n::kind>(dk_unable_to_decide),
- value_for<n::taken>(! resolution->constraints()->all_untaken_for_all())
+ value_for<n::taken>(! resolution->constraints()->all_untaken())
)));
}