aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
Diffstat (limited to 'paludis')
-rw-r--r--paludis/args/escape.cc17
-rw-r--r--paludis/args/man.cc8
-rw-r--r--paludis/changed_choices.cc16
-rw-r--r--paludis/elike_use_requirement.cc10
-rw-r--r--paludis/environment_implementation.cc14
-rw-r--r--paludis/environments/paludis/keywords_conf.cc21
-rw-r--r--paludis/environments/paludis/licenses_conf.cc35
-rw-r--r--paludis/environments/paludis/paludis_environment.cc9
-rw-r--r--paludis/environments/paludis/suggestions_conf.cc43
-rw-r--r--paludis/fs_merger.cc10
-rw-r--r--paludis/hooker.cc20
-rw-r--r--paludis/paludislike_options_conf.cc39
-rw-r--r--paludis/partitioning.cc5
-rw-r--r--paludis/repositories/e/can_skip_phase.cc7
-rw-r--r--paludis/repositories/e/dep_parser.cc15
-rw-r--r--paludis/repositories/e/do_install_action.cc11
-rw-r--r--paludis/repositories/e/e_choices_key.cc9
-rw-r--r--paludis/repositories/e/e_repository.cc25
-rw-r--r--paludis/repositories/e/eapi_phase.cc7
-rw-r--r--paludis/repositories/e/exheres_layout.cc26
-rw-r--r--paludis/repositories/e/exheres_mask_store.cc6
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc5
-rw-r--r--paludis/repositories/e/parse_dependency_label.cc12
-rw-r--r--paludis/repositories/e/permitted_directories.cc7
-rw-r--r--paludis/repositories/e/traditional_layout.cc24
-rw-r--r--paludis/repositories/e/traditional_mask_store.cc6
-rw-r--r--paludis/repositories/e/traditional_profile.cc52
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc18
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc18
-rw-r--r--paludis/resolver/find_replacing_helper.cc6
-rw-r--r--paludis/resolver/get_initial_constraints_for_helper.cc5
-rw-r--r--paludis/resolver/get_sameness.cc7
-rw-r--r--paludis/resolver/get_use_existing_nothing_helper.cc5
-rw-r--r--paludis/resolver/nag.cc33
-rw-r--r--paludis/resolver/sanitised_dependencies.cc17
-rw-r--r--paludis/selection.cc10
-rw-r--r--paludis/serialise.cc7
-rw-r--r--paludis/set_file.cc32
-rw-r--r--paludis/util/executor.cc5
-rw-r--r--paludis/util/md5.cc4
-rw-r--r--paludis/util/pool.cc5
-rw-r--r--paludis/util/process.cc5
-rw-r--r--paludis/util/rmd160.cc4
-rw-r--r--paludis/util/sha256.cc4
-rw-r--r--paludis/util/tee_output_stream.cc15
-rw-r--r--paludis/util/whirlpool.cc4
-rw-r--r--paludis/version_spec.cc28
47 files changed, 303 insertions, 388 deletions
diff --git a/paludis/args/escape.cc b/paludis/args/escape.cc
index 47b41b6de..eb4da18d8 100644
--- a/paludis/args/escape.cc
+++ b/paludis/args/escape.cc
@@ -27,17 +27,16 @@ const std::string
paludis::args::escape(const std::string & s)
{
std::stringstream result;
- for (std::string::const_iterator c(s.begin()), c_end(s.end()) ;
- c != c_end ; ++c)
+ for (char c : s)
{
- if ((*c >= 'a' && *c <= 'z') ||
- (*c >= 'A' && *c <= 'Z') ||
- (*c >= '0' && *c <= '9') ||
- *c == '-' ||
- *c == '_')
- result << *c;
+ if ((c >= 'a' && c <= 'z') ||
+ (c >= 'A' && c <= 'Z') ||
+ (c >= '0' && c <= '9') ||
+ c == '-' ||
+ c == '_')
+ result << c;
else
- result << '\\' << *c;
+ result << '\\' << c;
}
return result.str();
diff --git a/paludis/args/man.cc b/paludis/args/man.cc
index ff1a4d451..c79632da7 100644
--- a/paludis/args/man.cc
+++ b/paludis/args/man.cc
@@ -194,7 +194,7 @@ namespace
void escape_asciidoc(std::ostream & stream, const std::string & s)
{
char previous('\0');
- for (auto t(s.begin()), t_end(s.end()) ; t != t_end ; ++t)
+ for (char t : s)
{
switch (previous)
{
@@ -203,13 +203,13 @@ namespace
case '\n':
case '\t':
case '\'':
- if ('*' == *t)
+ if ('*' == t)
stream << '\\';
break;
// Escape '*/*' -> '\*/*'
}
- stream << *t;
- previous = *t;
+ stream << t;
+ previous = t;
}
}
}
diff --git a/paludis/changed_choices.cc b/paludis/changed_choices.cc
index 31421484f..53c01292b 100644
--- a/paludis/changed_choices.cc
+++ b/paludis/changed_choices.cc
@@ -61,14 +61,13 @@ ChangedChoices::empty() const
void
ChangedChoices::add_additional_requirements_to(PartiallyMadePackageDepSpec & spec) const
{
- for (auto o(_imp->overrides.begin()), o_end(_imp->overrides.end()) ;
- o != o_end ; ++o)
+ for (const auto & override : _imp->overrides)
{
- if (o->second)
- spec.additional_requirement(parse_elike_use_requirement("" + stringify(o->first) + "(-)",
+ if (override.second)
+ spec.additional_requirement(parse_elike_use_requirement("" + stringify(override.first) + "(-)",
{ euro_allow_default_values }, nullptr));
else
- spec.additional_requirement(parse_elike_use_requirement("-" + stringify(o->first) + "(-)",
+ spec.additional_requirement(parse_elike_use_requirement("-" + stringify(override.first) + "(-)",
{ euro_allow_default_values }, nullptr));
}
}
@@ -91,12 +90,11 @@ ChangedChoices::serialise(Serialiser & s) const
ss.member(SerialiserFlags<>(), "count", stringify(_imp->overrides.size()));
int n(0);
- for (auto o(_imp->overrides.begin()), o_end(_imp->overrides.end()) ;
- o != o_end ; ++o)
+ for (const auto & override : _imp->overrides)
{
++n;
- ss.member(SerialiserFlags<>(), stringify(n) + "a" , stringify(o->first));
- ss.member(SerialiserFlags<>(), stringify(n) + "b" , stringify(o->second));
+ ss.member(SerialiserFlags<>(), stringify(n) + "a" , stringify(override.first));
+ ss.member(SerialiserFlags<>(), stringify(n) + "b" , stringify(override.second));
}
}
diff --git a/paludis/elike_use_requirement.cc b/paludis/elike_use_requirement.cc
index 3699f7a84..31051c535 100644
--- a/paludis/elike_use_requirement.cc
+++ b/paludis/elike_use_requirement.cc
@@ -555,10 +555,9 @@ namespace
using namespace std::placeholders;
std::pair<bool, std::string> result(true, "");
- for (Reqs::const_iterator r(_reqs.begin()), r_end(_reqs.end()) ;
- r != r_end ; ++r)
+ for (const auto & _req : _reqs)
{
- std::pair<bool, std::string> r_result((*r)->requirement_met(env, maybe_changes_to_owner, id, from_id, maybe_changes_to_target));
+ std::pair<bool, std::string> r_result(_req->requirement_met(env, maybe_changes_to_owner, id, from_id, maybe_changes_to_target));
if (! r_result.first)
{
if (! result.first)
@@ -596,10 +595,9 @@ namespace
ChangedChoices & changed_choices) const
{
Tribool result(indeterminate);
- for (auto r(_reqs.begin()), r_end(_reqs.end()) ;
- r != r_end ; ++r)
+ for (const auto & _req : _reqs)
{
- auto b((*r)->accumulate_changes_to_make_met(env, maybe_changes_to_owner, id, from_id, changed_choices));
+ auto b(_req->accumulate_changes_to_make_met(env, maybe_changes_to_owner, id, from_id, changed_choices));
if (b.is_false())
return false;
else if (b.is_true())
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index fceaa932f..f4d535784 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -222,10 +222,8 @@ EnvironmentImplementation::remove_notifier_callback(const NotifierCallbackID i)
void
EnvironmentImplementation::trigger_notifier_callback(const NotifierCallbackEvent & e) const
{
- for (std::map<unsigned, NotifierCallbackFunction>::const_iterator i(_imp->notifier_callbacks.begin()),
- i_end(_imp->notifier_callbacks.end()) ;
- i != i_end ; ++i)
- (i->second)(e);
+ for (const auto & notifier_callback : _imp->notifier_callbacks)
+ (notifier_callback.second)(e);
}
void
@@ -369,12 +367,10 @@ EnvironmentImplementation::add_repository(int importance, const std::shared_ptr<
throw DuplicateRepositoryError(stringify(repository->name()));
std::list<std::shared_ptr<Repository> >::iterator q(_imp->repositories.end());
- for (std::multimap<int, std::list<std::shared_ptr<Repository> >::iterator>::iterator
- p(_imp->repository_importances.begin()), p_end(_imp->repository_importances.end()) ;
- p != p_end ; ++p)
- if (p->first > importance)
+ for (auto & repository_importance : _imp->repository_importances)
+ if (repository_importance.first > importance)
{
- q = p->second;
+ q = repository_importance.second;
break;
}
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 2b8c786f6..defcb97f6 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -145,22 +145,20 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::
SpecificMap::const_iterator i(_imp->qualified.find(e->name()));
if (i != _imp->qualified.end())
{
- for (PDSToKeywordsList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
- j != j_end ; ++j)
+ for (const auto & j : i->second)
{
- if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
+ if (! match_package(*_imp->env, *j.first, e, nullptr, { }))
continue;
- for (KeywordsList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j.second)
{
- if (*l == star_keyword)
+ if (l == star_keyword)
return true;
- else if (*l == minus_star_keyword)
+ else if (l == minus_star_keyword)
break_when_done = true;
- else if (k->end() != k->find(*l))
+ else if (k->end() != k->find(l))
return true;
}
}
@@ -217,13 +215,12 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const std::
if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
continue;
- for (KeywordsList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j->second)
{
- if (k->end() != k->find(*l))
+ if (k->end() != k->find(l))
return true;
- if (*l == star_keyword)
+ if (l == star_keyword)
return true;
}
}
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 7da32f1d2..0d6bfba97 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -139,20 +139,19 @@ namespace
void expand(const Environment * const env, LicensesList & list)
{
LicensesList extras;
- for (auto i(list.begin()), i_end(list.end()) ;
- i != i_end ; ++i)
+ for (auto & i : list)
{
- std::string s(*i);
+ std::string s(i);
if (0 == s.compare(0, 1, "-", 0, 1))
{
- auto l(env->expand_licence(i->substr(1)));
+ auto l(env->expand_licence(i.substr(1)));
for (auto v(l->begin()), v_end(l->end()) ;
v != v_end ; ++v)
extras.push_back("-" + *v);
}
else
{
- auto l(env->expand_licence(*i));
+ auto l(env->expand_licence(i));
for (auto v(l->begin()), v_end(l->end()) ;
v != v_end ; ++v)
extras.push_back(*v);
@@ -175,9 +174,8 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
for (auto q(_imp->qualified.begin()), q_end(_imp->qualified.end()) ;
q != q_end ; ++q)
{
- for (auto p(q->second.begin()), p_end(q->second.end()) ;
- p != p_end ; ++p)
- expand(_imp->env, p->second);
+ for (auto & p : q->second)
+ expand(_imp->env, p.second);
}
for (auto p(_imp->unqualified.begin()), p_end(_imp->unqualified.end()) ;
@@ -196,22 +194,20 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
SpecificMap::const_iterator i(_imp->qualified.find(e->name()));
if (i != _imp->qualified.end())
{
- for (PDSToLicensesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
- j != j_end ; ++j)
+ for (const auto & j : i->second)
{
- if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
+ if (! match_package(*_imp->env, *j.first, e, nullptr, { }))
continue;
- for (LicensesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j.second)
{
- if (*l == t)
+ if (l == t)
return true;
- if (*l == "*")
+ if (l == "*")
return true;
- if (*l == "-*")
+ if (l == "-*")
break_when_done = true;
}
}
@@ -267,13 +263,12 @@ LicensesConf::query(const std::string & t, const std::shared_ptr<const PackageID
if (! match_package(*_imp->env, *j->first, e, nullptr, { }))
continue;
- for (LicensesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j->second)
{
- if (*l == t)
+ if (l == t)
return true;
- if (*l == "*")
+ if (l == "*")
return true;
}
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 4bc180843..033ce77a2 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -507,15 +507,14 @@ PaludisEnvironment::populate_sets() const
sets_dirs.push_back(FSPath(LIBDIR) / "paludis" / "sets");
}
- for (auto sets_dir(sets_dirs.begin()), sets_dir_end(sets_dirs.end()) ;
- sets_dir != sets_dir_end ; ++ sets_dir)
+ for (auto & sets_dir : sets_dirs)
{
- Context context("When looking in sets directory '" + stringify(*sets_dir) + "':");
+ Context context("When looking in sets directory '" + stringify(sets_dir) + "':");
- if (! sets_dir->stat().exists())
+ if (! sets_dir.stat().exists())
continue;
- for (FSIterator d(*sets_dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
+ for (FSIterator d(sets_dir, { fsio_inode_sort }), d_end ; d != d_end ; ++d)
{
if (is_file_with_extension(*d, ".bash", { }))
{
diff --git a/paludis/environments/paludis/suggestions_conf.cc b/paludis/environments/paludis/suggestions_conf.cc
index bedf4046a..89529da6b 100644
--- a/paludis/environments/paludis/suggestions_conf.cc
+++ b/paludis/environments/paludis/suggestions_conf.cc
@@ -190,30 +190,28 @@ SuggestionsConf::interest_in_suggestion(
SpecificMap::const_iterator i(_imp->qualified.find(from_id->name()));
if (i != _imp->qualified.end())
{
- for (PDSToValuesList::const_iterator j(i->second.begin()), j_end(i->second.end()) ;
- j != j_end ; ++j)
+ for (const auto & j : i->second)
{
- if (! match_package(*_imp->env, *j->first, from_id, nullptr, { }))
+ if (! match_package(*_imp->env, *j.first, from_id, nullptr, { }))
continue;
- for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j.second)
{
- if (! l->group_requirement.empty())
+ if (! l.group_requirement.empty())
{
- if (spec_group == l->group_requirement)
- return l->negated ? false : true;
+ if (spec_group == l.group_requirement)
+ return l.negated ? false : true;
}
else
{
- if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (! l.pkg_requirement.empty())
+ if (stringify(spec.package_ptr()->package()) != l.pkg_requirement)
continue;
- if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (! l.cat_requirement.empty())
+ if (stringify(spec.package_ptr()->category()) != l.cat_requirement)
continue;
- return l->negated ? false : true;
+ return l.negated ? false : true;
}
}
}
@@ -271,24 +269,23 @@ SuggestionsConf::interest_in_suggestion(
if (! match_package(*_imp->env, *j->first, from_id, nullptr, { }))
continue;
- for (ValuesList::const_iterator l(j->second.begin()), l_end(j->second.end()) ;
- l != l_end ; ++l)
+ for (const auto & l : j->second)
{
- if (! l->group_requirement.empty())
+ if (! l.group_requirement.empty())
{
- if (spec_group == l->group_requirement)
- return l->negated ? false : true;
+ if (spec_group == l.group_requirement)
+ return l.negated ? false : true;
}
else
{
- if (! l->pkg_requirement.empty())
- if (stringify(spec.package_ptr()->package()) != l->pkg_requirement)
+ if (! l.pkg_requirement.empty())
+ if (stringify(spec.package_ptr()->package()) != l.pkg_requirement)
continue;
- if (! l->cat_requirement.empty())
- if (stringify(spec.package_ptr()->category()) != l->cat_requirement)
+ if (! l.cat_requirement.empty())
+ if (stringify(spec.package_ptr()->category()) != l.cat_requirement)
continue;
- return l->negated ? false : true;
+ return l.negated ? false : true;
}
}
}
diff --git a/paludis/fs_merger.cc b/paludis/fs_merger.cc
index 0fa032193..28132d229 100644
--- a/paludis/fs_merger.cc
+++ b/paludis/fs_merger.cc
@@ -156,14 +156,14 @@ FSMerger::prepare_install_under()
for (FSPath d(_imp->params.root().realpath() / _imp->params.install_under()), d_end(_imp->params.root().realpath()) ;
d != d_end ; d = d.dirname())
dd.push_front(d);
- for (std::list<FSPath>::iterator d(dd.begin()), d_end(dd.end()) ; d != d_end ; ++d)
- if (! d->stat().exists())
+ for (auto & d : dd)
+ if (! d.stat().exists())
{
- d->mkdir(0755, { });
- track_install_under_dir(*d, FSMergerStatusFlags());
+ d.mkdir(0755, { });
+ track_install_under_dir(d, FSMergerStatusFlags());
}
else
- track_install_under_dir(*d, FSMergerStatusFlags() + msi_used_existing);
+ track_install_under_dir(d, FSMergerStatusFlags() + msi_used_existing);
}
void
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index 9f1ec3851..1c339bff9 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -376,17 +376,16 @@ FancyHookFile::_add_dependency_class(const Hook & hook, DirectedGraph<std::strin
std::set<std::string> deps_s;
tokenise_whitespace(deps, std::inserter(deps_s, deps_s.end()));
- for (std::set<std::string>::const_iterator d(deps_s.begin()), d_end(deps_s.end()) ;
- d != d_end ; ++d)
+ for (const auto & deps_ : deps_s)
{
- if (g.has_node(*d))
- g.add_edge(strip_trailing_string(file_name().basename(), ".hook"), *d, 0);
+ if (g.has_node(deps_))
+ g.add_edge(strip_trailing_string(file_name().basename(), ".hook"), deps_, 0);
else if (depend)
Log::get_instance()->message("hook.fancy.dependency_not_found", ll_warning, lc_context)
- << "Hook dependency '" << *d << "' for '" << file_name() << "' not found";
+ << "Hook dependency '" << deps_ << "' for '" << file_name() << "' not found";
else
Log::get_instance()->message("hook.fancy.after_not_found", ll_debug, lc_context)
- << "Hook after '" << *d << "' for '" << file_name() << "' not found";
+ << "Hook after '" << deps_ << "' for '" << file_name() << "' not found";
}
}
else
@@ -490,10 +489,9 @@ namespace paludis
Context context("When loading auto hooks:");
- for (std::list<std::pair<FSPath, bool> >::const_iterator d(dirs.begin()), d_end(dirs.end()) ;
- d != d_end ; ++d)
+ for (const auto & dir : dirs)
{
- FSPath d_a(d->first / "auto");
+ FSPath d_a(dir.first / "auto");
if (! d_a.stat().is_directory())
continue;
@@ -504,12 +502,12 @@ namespace paludis
if (is_file_with_extension(*e, ".hook", { }))
{
- hook_file = std::make_shared<FancyHookFile>(*e, d->second, env);
+ hook_file = std::make_shared<FancyHookFile>(*e, dir.second, env);
name = strip_trailing_string(e->basename(), ".hook");
}
else if (is_file_with_extension(*e, so_suffix, { }))
{
- hook_file = std::make_shared<SoHookFile>(*e, d->second, env);
+ hook_file = std::make_shared<SoHookFile>(*e, dir.second, env);
name = strip_trailing_string(e->basename(), so_suffix);
}
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index 44291cc0c..68465aa63 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -362,15 +362,14 @@ namespace
std::string & result_value)
{
- for (ValuesGroups::const_iterator i(values_groups.begin()), i_end(values_groups.end()) ;
- i != i_end ; ++i)
+ for (const auto & values_group : values_groups)
{
- if (i->prefix() != prefix)
+ if (values_group.prefix() != prefix)
continue;
- seen_minus_star = seen_minus_star || i->minus_star();
+ seen_minus_star = seen_minus_star || values_group.minus_star();
- std::pair<Values::const_iterator, Values::const_iterator> range(i->values().equal_range(
+ std::pair<Values::const_iterator, Values::const_iterator> range(values_group.values().equal_range(
make_named_values<Value>(
n::equals_value() = "",
n::locked() = false,
@@ -398,15 +397,13 @@ namespace
const std::shared_ptr<Set<UnprefixedChoiceName> > & known)
{
- for (ValuesGroups::const_iterator i(values_groups.begin()), i_end(values_groups.end()) ;
- i != i_end ; ++i)
+ for (const auto & values_group : values_groups)
{
- if (i->prefix() != prefix)
+ if (values_group.prefix() != prefix)
continue;
- for (Values::const_iterator v(i->values().begin()), v_end(i->values().end()) ;
- v != v_end ; ++v)
- known->insert(v->unprefixed_name());
+ for (const auto & v : values_group.values())
+ known->insert(v.unprefixed_name());
}
}
@@ -420,22 +417,20 @@ namespace
std::pair<Tribool, bool> & result_state,
std::string & result_value)
{
- for (SpecsWithValuesGroups::const_iterator i(specs_with_values_groups.begin()),
- i_end(specs_with_values_groups.end()) ;
- i != i_end ; ++i)
+ for (const auto & specs_with_values_group : specs_with_values_groups)
{
if (maybe_id)
{
- if (! match_package(*env, i->spec(), maybe_id, nullptr, { }))
+ if (! match_package(*env, specs_with_values_group.spec(), maybe_id, nullptr, { }))
continue;
}
else
{
- if (! match_anything(i->spec()))
+ if (! match_anything(specs_with_values_group.spec()))
continue;
}
- check_values_groups(env, maybe_id, prefix, unprefixed_name, i->values_groups(),
+ check_values_groups(env, maybe_id, prefix, unprefixed_name, specs_with_values_group.values_groups(),
seen_minus_star, result_state, result_value);
}
}
@@ -447,22 +442,20 @@ namespace
const SpecsWithValuesGroups & specs_with_values_groups,
const std::shared_ptr<Set<UnprefixedChoiceName> > & known)
{
- for (SpecsWithValuesGroups::const_iterator i(specs_with_values_groups.begin()),
- i_end(specs_with_values_groups.end()) ;
- i != i_end ; ++i)
+ for (const auto & specs_with_values_group : specs_with_values_groups)
{
if (maybe_id)
{
- if (! match_package(*env, i->spec(), maybe_id, nullptr, { }))
+ if (! match_package(*env, specs_with_values_group.spec(), maybe_id, nullptr, { }))
continue;
}
else
{
- if (! match_anything(i->spec()))
+ if (! match_anything(specs_with_values_group.spec()))
continue;
}
- collect_known_from_values_groups(env, maybe_id, prefix, i->values_groups(), known);
+ collect_known_from_values_groups(env, maybe_id, prefix, specs_with_values_group.values_groups(), known);
}
}
}
diff --git a/paludis/partitioning.cc b/paludis/partitioning.cc
index afb3a0d06..c43bcd499 100644
--- a/paludis/partitioning.cc
+++ b/paludis/partitioning.cc
@@ -46,9 +46,8 @@ Partitioning::~Partitioning() = default;
void
Partitioning::mark(const std::vector<FSPath> & paths, const PartName & name)
{
- for (auto path = paths.begin(), path_end = paths.end();
- path != path_end; ++path)
- _imp->parts.push_back(std::make_pair(*path, name));
+ for (const auto & path : paths)
+ _imp->parts.push_back(std::make_pair(path, name));
}
PartName
diff --git a/paludis/repositories/e/can_skip_phase.cc b/paludis/repositories/e/can_skip_phase.cc
index afd951e18..4abe3c73f 100644
--- a/paludis/repositories/e/can_skip_phase.cc
+++ b/paludis/repositories/e/can_skip_phase.cc
@@ -48,10 +48,9 @@ paludis::erepository::can_skip_phase(
tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(skipifno, ",", "",
inserter(skip_if_no_values, skip_if_no_values.begin()));
- for (std::set<std::string>::const_iterator i(skip_if_no_values.begin()), i_end(skip_if_no_values.end()) ;
- i != i_end ; ++i)
+ for (const auto & skip_if_no_value : skip_if_no_values)
{
- if (*i == "*sources")
+ if (skip_if_no_value == "*sources")
{
if (id->fetches_key())
{
@@ -80,7 +79,7 @@ paludis::erepository::can_skip_phase(
else
{
auto d(id->defined_phases_key()->parse_value());
- if (d->end() != d->find(*i))
+ if (d->end() != d->find(skip_if_no_value))
return false;
}
}
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index ad49f4871..550904edd 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -494,9 +494,8 @@ namespace
continue;
case dsak_expandable:
- for (auto c(children.begin()), c_end(children.end()) ;
- c != c_end ; ++c)
- add_expanded_annotation(eapi, *c, *a);
+ for (const auto & c : children)
+ add_expanded_annotation(eapi, c, *a);
continue;
case last_dsak:
@@ -553,9 +552,8 @@ paludis::erepository::parse_depend(const std::string & s, const Environment * co
parse_elike_dependencies(s, callbacks, { });
- for (auto b(stack.begin()->block_children().begin()), b_end(stack.begin()->block_children().end()) ;
- b != b_end ; ++b)
- add_synthetic_block_annotations(eapi, b->first, b->second);
+ for (auto & b : stack.begin()->block_children())
+ add_synthetic_block_annotations(eapi, b.first, b.second);
return top;
}
@@ -604,9 +602,8 @@ paludis::erepository::parse_commented_set(const std::string & s, const Environme
parse_elike_dependencies(s, callbacks, { edpo_allow_embedded_comments });
- for (auto b(stack.begin()->block_children().begin()), b_end(stack.begin()->block_children().end()) ;
- b != b_end ; ++b)
- add_synthetic_block_annotations(eapi, b->first, b->second);
+ for (auto & b : stack.begin()->block_children())
+ add_synthetic_block_annotations(eapi, b.first, b.second);
return top;
}
diff --git a/paludis/repositories/e/do_install_action.cc b/paludis/repositories/e/do_install_action.cc
index 5730e2e51..efb7f024b 100644
--- a/paludis/repositories/e/do_install_action.cc
+++ b/paludis/repositories/e/do_install_action.cc
@@ -203,13 +203,12 @@ paludis::erepository::do_install_action(
{
std::vector<std::string> tokens;
tokenise_whitespace(id->eapi()->supported()->permitted_directories(), std::back_inserter(tokens));
- for (auto t(tokens.begin()), t_end(tokens.end()) ;
- t != t_end ; ++t)
+ for (auto & token : tokens)
{
- if (t->at(0) == '-')
- permitted_directories->add(FSPath(t->substr(1)), false);
- else if (t->at(0) == '+')
- permitted_directories->add(FSPath(t->substr(1)), true);
+ if (token.at(0) == '-')
+ permitted_directories->add(FSPath(token.substr(1)), false);
+ else if (token.at(0) == '+')
+ permitted_directories->add(FSPath(token.substr(1)), true);
else
throw InternalError(PALUDIS_HERE, "bad permitted_directories");
}
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 1e33b8c81..e55570b1a 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -605,15 +605,14 @@ EChoicesKey::populate_iuse(const std::shared_ptr<const Map<ChoiceNameWithPrefix,
if (IsExpand(i->first, delim)(*u))
values.insert(UnprefixedChoiceName(i->first.value().substr(u->length() + delim.length())));
- for (std::set<UnprefixedChoiceName>::const_iterator v(values.begin()), v_end(values.end()) ;
- v != v_end ; ++v)
+ for (const auto & value : values)
{
- std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator i(i_values.find(ChoiceNameWithPrefix(lower_u + delim + stringify(*v))));
+ std::map<ChoiceNameWithPrefix, ChoiceOptions>::const_iterator i(i_values.find(ChoiceNameWithPrefix(lower_u + delim + stringify(value))));
if (i_values.end() != i)
- exp->add(_imp->id->make_choice_value(exp, *v, i->second.default_value(), false, i->second.implicit() ? co_implicit : co_explicit,
+ exp->add(_imp->id->make_choice_value(exp, value, i->second.default_value(), false, i->second.implicit() ? co_implicit : co_explicit,
get_maybe_description(d, i->first), false, false));
else
- exp->add(_imp->id->make_choice_value(exp, *v, indeterminate, false, co_implicit, "", false, false));
+ exp->add(_imp->id->make_choice_value(exp, value, indeterminate, false, co_implicit, "", false, false));
}
}
}
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 91fc3f279..6264d4b1f 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1362,34 +1362,32 @@ ERepository::repository_factory_create(
std::vector<std::string> sync_tokens;
tokenise_whitespace(f("sync"), std::back_inserter(sync_tokens));
std::string source;
- for (auto t(sync_tokens.begin()), t_end(sync_tokens.end()) ;
- t != t_end ; ++t)
- if ((! t->empty()) && (':' == t->at(t->length() - 1)))
- source = t->substr(0, t->length() - 1);
+ for (auto & sync_token : sync_tokens)
+ if ((! sync_token.empty()) && (':' == sync_token.at(sync_token.length() - 1)))
+ source = sync_token.substr(0, sync_token.length() - 1);
else
{
std::string v;
if (sync->end() != sync->find(source))
v = sync->find(source)->second + " ";
sync->erase(source);
- sync->insert(source, v + *t);
+ sync->insert(source, v + sync_token);
}
auto sync_options(std::make_shared<Map<std::string, std::string> >());
std::vector<std::string> sync_options_tokens;
tokenise_whitespace(f("sync_options"), std::back_inserter(sync_options_tokens));
source = "";
- for (auto t(sync_options_tokens.begin()), t_end(sync_options_tokens.end()) ;
- t != t_end ; ++t)
- if ((! t->empty()) && (':' == t->at(t->length() - 1)))
- source = t->substr(0, t->length() - 1);
+ for (auto & sync_options_token : sync_options_tokens)
+ if ((! sync_options_token.empty()) && (':' == sync_options_token.at(sync_options_token.length() - 1)))
+ source = sync_options_token.substr(0, sync_options_token.length() - 1);
else
{
std::string v;
if (sync_options->end() != sync_options->find(source))
v = sync_options->find(source)->second + " ";
sync_options->erase(source);
- sync_options->insert(source, v + *t);
+ sync_options->insert(source, v + sync_options_token);
}
std::string builddir(f("builddir"));
@@ -1868,16 +1866,15 @@ ERepository::merge(const MergeParams & m)
}
if (_imp->params.write_cache() != FSPath("/var/empty"))
- for (auto r(replaces.begin()), r_end(replaces.end()) ;
- r != r_end ; ++r)
+ for (auto & replace : replaces)
{
FSPath cache(_imp->params.write_cache());
if (_imp->params.append_repository_name_to_write_cache())
cache /= stringify(name());
- cache /= stringify((*r)->name().category());
- cache /= (stringify((*r)->name().package()) + "-" + stringify((*r)->version()));
+ cache /= stringify(replace->name().category());
+ cache /= (stringify(replace->name().package()) + "-" + stringify(replace->version()));
if (cache.stat().is_regular_file_or_symlink_to_regular_file())
{
diff --git a/paludis/repositories/e/eapi_phase.cc b/paludis/repositories/e/eapi_phase.cc
index 5296da545..c6277dedd 100644
--- a/paludis/repositories/e/eapi_phase.cc
+++ b/paludis/repositories/e/eapi_phase.cc
@@ -90,10 +90,9 @@ EAPIPhase::option(const std::string & s) const
std::string
EAPIPhase::equal_option(const std::string & s) const
{
- for (std::set<std::string>::const_iterator i(_imp->options.begin()), i_end(_imp->options.end()) ;
- i != i_end ; ++i)
- if (0 == i->compare(0, s.length() + 1, s + "="))
- return i->substr(s.length() + 1);
+ for (const auto & option : _imp->options)
+ if (0 == option.compare(0, s.length() + 1, s + "="))
+ return option.substr(s.length() + 1);
return "";
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index b5f9c8fde..502301fc3 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -591,24 +591,23 @@ namespace
return;
std::list<FSPath> files((FSIterator(d, { })), FSIterator());
- for (std::list<FSPath>::iterator f(files.begin()) ;
- f != files.end() ; ++f)
+ for (auto & file : files)
{
- FSStat f_stat(f->stat());
+ FSStat f_stat(file.stat());
if (f_stat.is_directory())
{
- if ("CVS" != f->basename())
- aux_files_helper((*f), m, qpn);
+ if ("CVS" != file.basename())
+ aux_files_helper(file, m, qpn);
}
else
{
if (! f_stat.is_regular_file())
continue;
- if (is_file_with_prefix_extension((*f),
+ if (is_file_with_prefix_extension(file,
("digest-"+stringify(qpn.package())), "",
{ }))
continue;
- m->insert((*f), "AUX");
+ m->insert(file, "AUX");
}
}
}
@@ -620,18 +619,17 @@ ExheresLayout::manifest_files(const QualifiedPackageName & qpn, const FSPath & p
auto result(std::make_shared<Map<FSPath, std::string, FSPathComparator>>());
std::list<FSPath> package_files((FSIterator(package_dir, { })), FSIterator());
- for (std::list<FSPath>::iterator f(package_files.begin()) ;
- f != package_files.end() ; ++f)
+ for (auto & package_file : package_files)
{
- FSStat f_stat(f->stat());
- if (! f_stat.is_regular_file() || ((*f).basename() == "Manifest") )
+ FSStat f_stat(package_file.stat());
+ if (! f_stat.is_regular_file() || (package_file.basename() == "Manifest") )
continue;
std::string file_type("MISC");
- if (FileSuffixes::get_instance()->is_package_file(qpn, (*f)))
- file_type = FileSuffixes::get_instance()->get_package_file_manifest_key((*f), qpn);
+ if (FileSuffixes::get_instance()->is_package_file(qpn, package_file))
+ file_type = FileSuffixes::get_instance()->get_package_file_manifest_key(package_file, qpn);
- result->insert((*f), file_type);
+ result->insert(package_file, file_type);
}
aux_files_helper((package_dir / "files"), result, qpn);
diff --git a/paludis/repositories/e/exheres_mask_store.cc b/paludis/repositories/e/exheres_mask_store.cc
index 5813c0e90..6b2b70db9 100644
--- a/paludis/repositories/e/exheres_mask_store.cc
+++ b/paludis/repositories/e/exheres_mask_store.cc
@@ -189,9 +189,9 @@ ExheresMaskStore::query(const std::shared_ptr<const PackageID> & id) const
auto result(std::make_shared<MasksInfo>());
auto r(_imp->repo_mask.find(id->name()));
if (_imp->repo_mask.end() != r)
- for (auto k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
- if (match_package(*_imp->env, k->first, id, nullptr, { }))
- result->push_back(*k->second);
+ for (const auto & k : r->second)
+ if (match_package(*_imp->env, k.first, id, nullptr, { }))
+ result->push_back(*k.second);
return result;
}
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index a47d35783..7abddcfc2 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -257,9 +257,8 @@ MyOptionsRequirementsVerifier::visit(const PlainTextSpecTree::NodeType<PlainText
std::shared_ptr<const ChoiceValue> choice_value(find_choice_value(_imp->id, *_imp->current_prefix_stack.begin(), active_flag));
if (choice_value && choice_value->enabled() == active_myoption.second)
- for (std::list<int>::iterator l(_imp->number_enabled_stack.begin()), l_end(_imp->number_enabled_stack.end()) ;
- l != l_end ; ++l)
- ++*l;
+ for (int & l : _imp->number_enabled_stack)
+ ++l;
}
if ((! node.spec()->maybe_annotations()) || (node.spec()->maybe_annotations()->begin() == node.spec()->maybe_annotations()->end()))
diff --git a/paludis/repositories/e/parse_dependency_label.cc b/paludis/repositories/e/parse_dependency_label.cc
index 9f4588858..021cc3e06 100644
--- a/paludis/repositories/e/parse_dependency_label.cc
+++ b/paludis/repositories/e/parse_dependency_label.cc
@@ -176,11 +176,11 @@ paludis::erepository::parse_dependency_label(
std::shared_ptr<DependenciesLabelsDepSpec> l(std::make_shared<DependenciesLabelsDepSpec>());
- for (std::set<std::string>::iterator it = labels.begin(), it_e = labels.end(); it != it_e; ++it)
+ for (const auto & label : labels)
{
- std::string c(e.supported()->dependency_labels()->class_for_label(*it)), cc;
+ std::string c(e.supported()->dependency_labels()->class_for_label(label)), cc;
if (c.empty())
- throw EDepParseError(s, "Unknown label '" + *it + "'");
+ throw EDepParseError(s, "Unknown label '" + label + "'");
std::string::size_type p(c.find('/'));
if (std::string::npos != p)
@@ -192,12 +192,12 @@ paludis::erepository::parse_dependency_label(
if (c == "DependenciesTestLabel")
{
if (cc.empty())
- l->add_label(DepLabelsStore::get_instance()->get(e.name(), c, *it));
+ l->add_label(DepLabelsStore::get_instance()->get(e.name(), c, label));
else
- l->add_label(DepLabelsStore::get_instance()->get_test(e.name(), c, ChoiceNameWithPrefix(cc), *it));
+ l->add_label(DepLabelsStore::get_instance()->get_test(e.name(), c, ChoiceNameWithPrefix(cc), label));
}
else
- l->add_label(DepLabelsStore::get_instance()->get(e.name(), c, *it));
+ l->add_label(DepLabelsStore::get_instance()->get(e.name(), c, label));
}
return l;
diff --git a/paludis/repositories/e/permitted_directories.cc b/paludis/repositories/e/permitted_directories.cc
index bb2d76f8a..204b0b4da 100644
--- a/paludis/repositories/e/permitted_directories.cc
+++ b/paludis/repositories/e/permitted_directories.cc
@@ -53,10 +53,9 @@ PermittedDirectories::permit(const FSPath & p) const
{
bool result(true);
- for (auto r(_imp->rules.begin()), r_end(_imp->rules.end()) ;
- r != r_end ; ++r)
- if (p.starts_with(r->first))
- result = r->second;
+ for (const auto & rule : _imp->rules)
+ if (p.starts_with(rule.first))
+ result = rule.second;
return result;
}
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 6d8b56865..33b78a06e 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -608,24 +608,23 @@ namespace
return;
std::list<FSPath> files((FSIterator(d, { fsio_inode_sort })), FSIterator());
- for (std::list<FSPath>::iterator f(files.begin()) ;
- f != files.end() ; ++f)
+ for (auto & file : files)
{
- FSStat f_stat(f->stat());
+ FSStat f_stat(file.stat());
if (f_stat.is_directory())
{
- if ("CVS" != f->basename())
- aux_files_helper((*f), m, qpn);
+ if ("CVS" != file.basename())
+ aux_files_helper(file, m, qpn);
}
else
{
if (! f_stat.is_regular_file())
continue;
- if (is_file_with_prefix_extension((*f),
+ if (is_file_with_prefix_extension(file,
("digest-"+stringify(qpn.package())), "",
{ }))
continue;
- m->insert((*f), "AUX");
+ m->insert(file, "AUX");
}
}
}
@@ -637,17 +636,16 @@ TraditionalLayout::manifest_files(const QualifiedPackageName & qpn, const FSPath
auto result(std::make_shared<Map<FSPath, std::string, FSPathComparator>>());
std::list<FSPath> package_files((FSIterator(package_dir, { fsio_inode_sort, fsio_want_regular_files })), FSIterator());
- for (std::list<FSPath>::iterator f(package_files.begin()) ;
- f != package_files.end() ; ++f)
+ for (auto & package_file : package_files)
{
- if ((*f).basename() == "Manifest")
+ if (package_file.basename() == "Manifest")
continue;
std::string file_type("MISC");
- if (FileSuffixes::get_instance()->is_package_file(qpn, (*f)))
- file_type = FileSuffixes::get_instance()->get_package_file_manifest_key((*f), qpn);
+ if (FileSuffixes::get_instance()->is_package_file(qpn, package_file))
+ file_type = FileSuffixes::get_instance()->get_package_file_manifest_key(package_file, qpn);
- result->insert((*f), file_type);
+ result->insert(package_file, file_type);
}
aux_files_helper((package_dir / "files"), result, qpn);
diff --git a/paludis/repositories/e/traditional_mask_store.cc b/paludis/repositories/e/traditional_mask_store.cc
index 3017bcdbc..66d72c207 100644
--- a/paludis/repositories/e/traditional_mask_store.cc
+++ b/paludis/repositories/e/traditional_mask_store.cc
@@ -123,9 +123,9 @@ TraditionalMaskStore::query(const std::shared_ptr<const PackageID> & id) const
auto result(std::make_shared<MasksInfo>());
auto r(_imp->repo_mask.find(id->name()));
if (_imp->repo_mask.end() != r)
- for (auto k(r->second.begin()), k_end(r->second.end()) ; k != k_end ; ++k)
- if (match_package(*_imp->env, k->first, id, nullptr, { }))
- result->push_back(*k->second);
+ for (const auto & k : r->second)
+ if (match_package(*_imp->env, k.first, id, nullptr, { }))
+ result->push_back(*k.second);
return result;
}
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index 567b9b56b..46e4d4d25 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -827,27 +827,25 @@ TraditionalProfile::use_masked(
result = fs->second;
}
- for (PackageFlagStatusMapList::const_iterator g(i->package_use_mask.begin()),
- g_end(i->package_use_mask.end()) ; g != g_end ; ++g)
+ for (const auto & g : i->package_use_mask)
{
- if (! match_package(*_imp->env, *g->first, id, nullptr, { }))
+ if (! match_package(*_imp->env, *g.first, id, nullptr, { }))
continue;
- FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
- if (g->second.end() != h)
+ FlagStatusMap::const_iterator h(g.second.find(value_prefixed));
+ if (g.second.end() != h)
result = h->second;
}
if (id->is_stable())
{
- for (PackageFlagStatusMapList::const_iterator gs(i->package_use_stable_mask.begin()),
- gs_end(i->package_use_stable_mask.end()) ; gs != gs_end ; ++gs)
+ for (const auto & gs : i->package_use_stable_mask)
{
- if (! match_package(*_imp->env, *gs->first, id, nullptr, { }))
+ if (! match_package(*_imp->env, *gs.first, id, nullptr, { }))
continue;
- FlagStatusMap::const_iterator hs(gs->second.find(value_prefixed));
- if (gs->second.end() != hs)
+ FlagStatusMap::const_iterator hs(gs.second.find(value_prefixed));
+ if (gs.second.end() != hs)
result = hs->second;
}
}
@@ -884,27 +882,25 @@ TraditionalProfile::use_forced(
result = fs->second;
}
- for (PackageFlagStatusMapList::const_iterator g(i->package_use_force.begin()),
- g_end(i->package_use_force.end()) ; g != g_end ; ++g)
+ for (const auto & g : i->package_use_force)
{
- if (! match_package(*_imp->env, *g->first, id, nullptr, { }))
+ if (! match_package(*_imp->env, *g.first, id, nullptr, { }))
continue;
- FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
- if (g->second.end() != h)
+ FlagStatusMap::const_iterator h(g.second.find(value_prefixed));
+ if (g.second.end() != h)
result = h->second;
}
if (id->is_stable())
{
- for (PackageFlagStatusMapList::const_iterator gs(i->package_use_stable_force.begin()),
- gs_end(i->package_use_stable_force.end()) ; gs != gs_end ; ++gs)
+ for (const auto & gs : i->package_use_stable_force)
{
- if (! match_package(*_imp->env, *gs->first, id, nullptr, { }))
+ if (! match_package(*_imp->env, *gs.first, id, nullptr, { }))
continue;
- FlagStatusMap::const_iterator hs(gs->second.find(value_prefixed));
- if (gs->second.end() != hs)
+ FlagStatusMap::const_iterator hs(gs.second.find(value_prefixed));
+ if (gs.second.end() != hs)
result = hs->second;
}
}
@@ -927,14 +923,13 @@ TraditionalProfile::use_state_ignoring_masks(
for (StackedValuesList::const_iterator i(_imp->stacked_values_list.begin()),
i_end(_imp->stacked_values_list.end()) ; i != i_end ; ++i)
{
- for (PackageFlagStatusMapList::const_iterator g(i->package_use.begin()),
- g_end(i->package_use.end()) ; g != g_end ; ++g)
+ for (const auto & g : i->package_use)
{
- if (! match_package(*_imp->env, *g->first, id, nullptr, { }))
+ if (! match_package(*_imp->env, *g.first, id, nullptr, { }))
continue;
- FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
- if (g->second.end() != h)
+ FlagStatusMap::const_iterator h(g.second.find(value_prefixed));
+ if (g.second.end() != h)
result = h->second ? true : false;
}
}
@@ -1029,10 +1024,9 @@ TraditionalProfile::profile_masks(const std::shared_ptr<const PackageID> & id) c
PackageMaskMap::const_iterator rr(_imp->package_mask.find(id->name()));
if (_imp->package_mask.end() != rr)
{
- for (std::list<std::pair<std::shared_ptr<const PackageDepSpec>, std::shared_ptr<const MaskInfo> > >::const_iterator k(rr->second.begin()),
- k_end(rr->second.end()) ; k != k_end ; ++k)
- if (match_package(*_imp->env, *k->first, id, nullptr, { }))
- result->push_back(*k->second);
+ for (const auto & k : rr->second)
+ if (match_package(*_imp->env, *k.first, id, nullptr, { }))
+ result->push_back(*k.second);
}
return result;
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index a0da0bed5..aad388325 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -343,34 +343,32 @@ UnavailableRepository::repository_factory_create(
std::vector<std::string> sync_tokens;
tokenise_whitespace(f("sync"), std::back_inserter(sync_tokens));
std::string source;
- for (auto t(sync_tokens.begin()), t_end(sync_tokens.end()) ;
- t != t_end ; ++t)
- if ((! t->empty()) && (':' == t->at(t->length() - 1)))
- source = t->substr(0, t->length() - 1);
+ for (auto & sync_token : sync_tokens)
+ if ((! sync_token.empty()) && (':' == sync_token.at(sync_token.length() - 1)))
+ source = sync_token.substr(0, sync_token.length() - 1);
else
{
std::string v;
if (sync->end() != sync->find(source))
v = sync->find(source)->second + " ";
sync->erase(source);
- sync->insert(source, v + *t);
+ sync->insert(source, v + sync_token);
}
auto sync_options(std::make_shared<Map<std::string, std::string> >());
std::vector<std::string> sync_options_tokens;
tokenise_whitespace(f("sync_options"), std::back_inserter(sync_options_tokens));
source = "";
- for (auto t(sync_options_tokens.begin()), t_end(sync_options_tokens.end()) ;
- t != t_end ; ++t)
- if ((! t->empty()) && (':' == t->at(t->length() - 1)))
- source = t->substr(0, t->length() - 1);
+ for (auto & sync_options_token : sync_options_tokens)
+ if ((! sync_options_token.empty()) && (':' == sync_options_token.at(sync_options_token.length() - 1)))
+ source = sync_options_token.substr(0, sync_options_token.length() - 1);
else
{
std::string v;
if (sync_options->end() != sync_options->find(source))
v = sync_options->find(source)->second + " ";
sync_options->erase(source);
- sync_options->insert(source, v + *t);
+ sync_options->insert(source, v + sync_options_token);
}
return std::make_shared<UnavailableRepository>(
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index c0b21de74..a1bbf3142 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -299,34 +299,32 @@ UnwrittenRepository::repository_factory_create(
std::vector<std::string> sync_tokens;
tokenise_whitespace(f("sync"), std::back_inserter(sync_tokens));
std::string source;
- for (auto t(sync_tokens.begin()), t_end(sync_tokens.end()) ;
- t != t_end ; ++t)
- if ((! t->empty()) && (':' == t->at(t->length() - 1)))
- source = t->substr(0, t->length() - 1);
+ for (auto & sync_token : sync_tokens)
+ if ((! sync_token.empty()) && (':' == sync_token.at(sync_token.length() - 1)))
+ source = sync_token.substr(0, sync_token.length() - 1);
else
{
std::string v;
if (sync->end() != sync->find(source))
v = sync->find(source)->second + " ";
sync->erase(source);
- sync->insert(source, v + *t);
+ sync->insert(source, v + sync_token);
}
auto sync_options(std::make_shared<Map<std::string, std::string> >());
std::vector<std::string> sync_options_tokens;
tokenise_whitespace(f("sync_options"), std::back_inserter(sync_options_tokens));
source = "";
- for (auto t(sync_options_tokens.begin()), t_end(sync_options_tokens.end()) ;
- t != t_end ; ++t)
- if ((! t->empty()) && (':' == t->at(t->length() - 1)))
- source = t->substr(0, t->length() - 1);
+ for (auto & sync_options_token : sync_options_tokens)
+ if ((! sync_options_token.empty()) && (':' == sync_options_token.at(sync_options_token.length() - 1)))
+ source = sync_options_token.substr(0, sync_options_token.length() - 1);
else
{
std::string v;
if (sync_options->end() != sync_options->find(source))
v = sync_options->find(source)->second + " ";
sync_options->erase(source);
- sync_options->insert(source, v + *t);
+ sync_options->insert(source, v + sync_options_token);
}
return std::make_shared<UnwrittenRepository>(
diff --git a/paludis/resolver/find_replacing_helper.cc b/paludis/resolver/find_replacing_helper.cc
index dafe3b6bf..98c869615 100644
--- a/paludis/resolver/find_replacing_helper.cc
+++ b/paludis/resolver/find_replacing_helper.cc
@@ -95,12 +95,10 @@ FindReplacingHelper::operator() (
repos.insert(repo->name());
std::shared_ptr<PackageIDSequence> result(std::make_shared<PackageIDSequence>());
- for (std::set<RepositoryName>::const_iterator r(repos.begin()),
- r_end(repos.end()) ;
- r != r_end ; ++r)
+ for (const auto & r : repos)
{
std::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::AllVersionsUnsorted(
- generator::Package(id->name()) & generator::InRepository(*r))]);
+ generator::Package(id->name()) & generator::InRepository(r))]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
diff --git a/paludis/resolver/get_initial_constraints_for_helper.cc b/paludis/resolver/get_initial_constraints_for_helper.cc
index 463086063..8a7de9567 100644
--- a/paludis/resolver/get_initial_constraints_for_helper.cc
+++ b/paludis/resolver/get_initial_constraints_for_helper.cc
@@ -214,9 +214,8 @@ namespace
const QualifiedPackageName & name,
const std::list<PackageDepSpec> & list)
{
- for (auto l(list.begin()), l_end(list.end()) ;
- l != l_end ; ++l)
- if (match_qpns(*env, *l, name))
+ for (const auto & l : list)
+ if (match_qpns(*env, l, name))
return true;
return false;
}
diff --git a/paludis/resolver/get_sameness.cc b/paludis/resolver/get_sameness.cc
index 29c8a2ab7..6f95f083e 100644
--- a/paludis/resolver/get_sameness.cc
+++ b/paludis/resolver/get_sameness.cc
@@ -185,10 +185,9 @@ paludis::resolver::get_sameness(
std::inserter(common, common.begin()));
}
- for (std::set<ChoiceNameWithPrefix>::const_iterator f(common.begin()), f_end(common.end()) ;
- f != f_end ; ++f)
- if (installable_choices->find_by_name_with_prefix(*f)->enabled() !=
- existing_choices->find_by_name_with_prefix(*f)->enabled())
+ for (const auto & f : common)
+ if (installable_choices->find_by_name_with_prefix(f)->enabled() !=
+ existing_choices->find_by_name_with_prefix(f)->enabled())
{
is_same = false;
is_same_metadata = false;
diff --git a/paludis/resolver/get_use_existing_nothing_helper.cc b/paludis/resolver/get_use_existing_nothing_helper.cc
index 6111d3ad9..f1416253d 100644
--- a/paludis/resolver/get_use_existing_nothing_helper.cc
+++ b/paludis/resolver/get_use_existing_nothing_helper.cc
@@ -105,9 +105,8 @@ namespace
const QualifiedPackageName & name,
const std::list<PackageDepSpec> & list)
{
- for (auto l(list.begin()), l_end(list.end()) ;
- l != l_end ; ++l)
- if (match_qpns(*env, *l, name))
+ for (const auto & l : list)
+ if (match_qpns(*env, l, name))
return true;
return false;
}
diff --git a/paludis/resolver/nag.cc b/paludis/resolver/nag.cc
index 587243b5a..31a09e64f 100644
--- a/paludis/resolver/nag.cc
+++ b/paludis/resolver/nag.cc
@@ -197,16 +197,15 @@ namespace
Edges::const_iterator e(edges.find(node));
if (e != edges.end())
{
- for (NodesWithProperties::const_iterator n(e->second.begin()), n_end(e->second.end()) ;
- n != n_end ; ++n)
+ for (const auto & n : e->second)
{
- TarjanDataMap::iterator n_data(data.find(n->first));
+ TarjanDataMap::iterator n_data(data.find(n.first));
if (data.end() == n_data)
{
- n_data = tarjan(n->first, edges, data, stack, index, result);
+ n_data = tarjan(n.first, edges, data, stack, index, result);
node_data->second.lowlink() = std::min(node_data->second.lowlink(), n_data->second.lowlink());
}
- else if (stack.end() != std::find(stack.begin(), stack.end(), n->first))
+ else if (stack.end() != std::find(stack.begin(), stack.end(), n.first))
node_data->second.lowlink() = std::min(node_data->second.lowlink(), n_data->second.index());
}
}
@@ -302,14 +301,12 @@ NAG::sorted_strongly_connected_components(
/* build edges between SCCs */
PlainEdges all_scc_edges, scc_edges, scc_edges_backwards;
- for (Edges::const_iterator e(_imp->edges.begin()), e_end(_imp->edges.end()) ;
- e != e_end ; ++e)
+ for (const auto & edge : _imp->edges)
{
- RepresentativeNodes::const_iterator from(representative_nodes.find(e->first));
- for (NodesWithProperties::const_iterator n(e->second.begin()), n_end(e->second.end()) ;
- n != n_end ; ++n)
+ RepresentativeNodes::const_iterator from(representative_nodes.find(edge.first));
+ for (const auto & n : edge.second)
{
- RepresentativeNodes::const_iterator to(representative_nodes.find(n->first));
+ RepresentativeNodes::const_iterator to(representative_nodes.find(n.first));
if (! (to->second == from->second))
{
all_scc_edges.insert(std::make_pair(from->second, Nodes())).first->second.insert(to->second);
@@ -344,13 +341,12 @@ NAG::sorted_strongly_connected_components(
auto this_scc_edges(all_scc_edges.find(ordering_now->second));
if (this_scc_edges != all_scc_edges.end())
{
- for (auto e(this_scc_edges->second.begin()), e_end(this_scc_edges->second.end()) ;
- e != e_end ; ++e)
+ for (const auto & e : this_scc_edges->second)
{
- auto p(pending_fetches.find(*e));
+ auto p(pending_fetches.find(e));
if (p != pending_fetches.end())
{
- result->push_back(sccs.find(*e)->second);
+ result->push_back(sccs.find(e)->second);
pending_fetches.erase(p);
}
}
@@ -431,14 +427,13 @@ NAG::serialise(Serialiser & s) const
w.member(SerialiserFlags<serialise::container>(), "nodes", _imp->nodes);
int c(0);
- for (Edges::const_iterator e(_imp->edges.begin()), e_end(_imp->edges.end()) ;
- e != e_end ; ++e)
+ for (const auto & edge : _imp->edges)
{
- for (NodesWithProperties::const_iterator n(e->second.begin()), n_end(e->second.end()) ;
+ for (NodesWithProperties::const_iterator n(edge.second.begin()), n_end(edge.second.end()) ;
n != n_end ; ++n)
{
++c;
- w.member(SerialiserFlags<>(), "edge." + stringify(c) + ".f", e->first);
+ w.member(SerialiserFlags<>(), "edge." + stringify(c) + ".f", edge.first);
w.member(SerialiserFlags<>(), "edge." + stringify(c) + ".t", n->first);
w.member(SerialiserFlags<>(), "edge." + stringify(c) + ".p", n->second);
}
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 1954c0ad5..0ac5969d6 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -274,15 +274,14 @@ namespace
std::pair<AnyChildScore, OperatorScore> worst_score(acs_better_than_best, os_better_than_best);
/* score of a group is the score of the worst child. */
- for (std::list<PackageOrBlockDepSpec>::const_iterator h(g->begin()), h_end(g->end()) ;
- h != h_end ; ++h)
+ for (const auto & h : *g)
{
- auto s(maybe_make_sanitised(PackageOrBlockDepSpec(*h)));
+ auto s(maybe_make_sanitised(PackageOrBlockDepSpec(h)));
if (s)
{
auto score(decider.find_any_score(our_resolution, our_id, *s));
Log::get_instance()->message("resolver.sanitised_dependencies.any_score", ll_debug, lc_context)
- << "Scored " << *h << " as " << score.first << " " << score.second;
+ << "Scored " << h << " as " << score.first << " " << score.second;
if (score < worst_score)
worst_score = score;
@@ -299,10 +298,9 @@ namespace
if (g_best != child_groups.end())
{
/* might be nothing to do, if no labels are enabled */
- for (std::list<PackageOrBlockDepSpec>::const_iterator h(g_best->begin()), h_end(g_best->end()) ;
- h != h_end ; ++h)
+ for (const auto & h : *g_best)
{
- auto s(maybe_make_sanitised(*h));
+ auto s(maybe_make_sanitised(h));
if (s)
apply(*s);
}
@@ -370,9 +368,8 @@ namespace
auto classifier(classifier_builder->create());
if (classifier->any_enabled)
{
- for (auto c(conditions_stack.begin()), c_end(conditions_stack.end()) ;
- c != c_end ; ++c)
- acs << (acs.str().empty() ? "" : ", ") << stringify(*c);
+ for (auto & c : conditions_stack)
+ acs << (acs.str().empty() ? "" : ", ") << stringify(c);
return make_shared_copy(make_named_values<SanitisedDependency>(
n::active_conditions_as_string() = acs.str(),
diff --git a/paludis/selection.cc b/paludis/selection.cc
index 9a6e6325c..74e7c5f4b 100644
--- a/paludis/selection.cc
+++ b/paludis/selection.cc
@@ -326,9 +326,8 @@ namespace
}
PackageIDComparator comparator(env);
- for (SlotMap::iterator i(by_slot.begin()), i_end(by_slot.end()) ;
- i != i_end ; ++i)
- i->second->sort(comparator);
+ for (auto & i : by_slot)
+ i.second->sort(comparator);
while (! by_slot.empty())
{
@@ -393,9 +392,8 @@ namespace
}
PackageIDComparator comparator(env);
- for (SlotMap::iterator i(by_slot.begin()), i_end(by_slot.end()) ;
- i != i_end ; ++i)
- i->second->sort(comparator);
+ for (auto & i : by_slot)
+ i.second->sort(comparator);
while (! by_slot.empty())
{
diff --git a/paludis/serialise.cc b/paludis/serialise.cc
index 24f18beec..6d17c36a6 100644
--- a/paludis/serialise.cc
+++ b/paludis/serialise.cc
@@ -102,9 +102,8 @@ SerialiserObjectWriterHandler<false, false, const PackageID>::write(Serialiser &
void
Serialiser::escape_write(const std::string & t)
{
- for (std::string::const_iterator c(t.begin()), c_end(t.end()) ;
- c != c_end ; ++c)
- switch (*c)
+ for (char c : t)
+ switch (c)
{
case '\\':
case '"':
@@ -114,7 +113,7 @@ Serialiser::escape_write(const std::string & t)
raw_stream() << '\\';
/* fall through */
default:
- raw_stream() << *c;
+ raw_stream() << c;
}
}
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 313a22a2e..00a5747f7 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -319,27 +319,26 @@ SimpleHandler::_create_contents() const
Context context("When parsing atoms in simple set file '" + stringify(_p.file_name()) + "':");
_contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
- for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
- i != i_end ; ++i)
+ for (const auto & _line : _lines)
{
- if (i->empty())
+ if (_line.empty())
continue;
- if ('#' == i->at(0))
+ if ('#' == _line.at(0))
continue;
- Context c("When handling line '" + stringify(*i) + "':");
+ Context c("When handling line '" + stringify(_line) + "':");
try
{
- if (std::string::npos == i->find('/'))
+ if (std::string::npos == _line.find('/'))
{
- std::shared_ptr<NamedSetDepSpec> p(std::make_shared<NamedSetDepSpec>(SetName(*i)));
+ std::shared_ptr<NamedSetDepSpec> p(std::make_shared<NamedSetDepSpec>(SetName(_line)));
_contents->top()->append(p);
}
else
{
- std::shared_ptr<PackageDepSpec> p(std::make_shared<PackageDepSpec>(_p.parser()(stringify(*i))));
+ std::shared_ptr<PackageDepSpec> p(std::make_shared<PackageDepSpec>(_p.parser()(stringify(_line))));
_contents->top()->append(p);
}
}
@@ -350,7 +349,7 @@ SimpleHandler::_create_contents() const
catch (const Exception & e)
{
Log::get_instance()->message("set_file.ignoring_line", ll_warning, lc_context)
- << "Ignoring line '" << *i << "' due to exception '" << e.message() << "' (" << e.what() << "'";
+ << "Ignoring line '" << _line << "' due to exception '" << e.message() << "' (" << e.what() << "'";
}
}
}
@@ -417,9 +416,8 @@ SimpleHandler::rewrite() const
{
SafeOFStream f(_p.file_name(), -1, true);
- for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
- i != i_end ; ++i)
- f << *i << std::endl;
+ for (const auto & _line : _lines)
+ f << _line << std::endl;
}
catch (const SafeOFStreamError & e)
{
@@ -445,9 +443,8 @@ PaludisConfHandler::_create_contents() const
Context context("When parsing atoms in paludis conf set file '" + stringify(_p.file_name()) + "':");
_contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
- for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
- i != i_end ; ++i)
- do_one_conf_line(*i, _contents, _p);
+ for (const auto & _line : _lines)
+ do_one_conf_line(_line, _contents, _p);
}
std::shared_ptr<SetSpecTree>
@@ -510,9 +507,8 @@ PaludisConfHandler::rewrite() const
{
SafeOFStream f(_p.file_name(), -1, true);
- for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
- i != i_end ; ++i)
- f << *i << std::endl;
+ for (const auto & _line : _lines)
+ f << _line << std::endl;
}
catch (const SafeOFStreamError & e)
{
diff --git a/paludis/util/executor.cc b/paludis/util/executor.cc
index 136de2eda..621146e51 100644
--- a/paludis/util/executor.cc
+++ b/paludis/util/executor.cc
@@ -157,9 +157,8 @@ Executor::execute()
_imp->condition.wait_for(lock, std::chrono::milliseconds(_imp->ms_update_interval));
- for (Running::iterator r(running.begin()), r_end(running.end()) ;
- r != r_end ; ++r)
- r->second.second->flush_threaded();
+ for (auto & r : running)
+ r.second.second->flush_threaded();
for (ReadyForPost::iterator p(_imp->ready_for_post.begin()), p_end(_imp->ready_for_post.end()) ;
p != p_end ; ++p)
diff --git a/paludis/util/md5.cc b/paludis/util/md5.cc
index 727ee16b0..b736c9db8 100644
--- a/paludis/util/md5.cc
+++ b/paludis/util/md5.cc
@@ -187,9 +187,9 @@ MD5::hexsum() const
{
std::stringstream result;
- for (int j(0) ; j < 4 ; ++j)
+ for (unsigned int j : _r)
result << std::hex << std::right << std::setw(8) << std::setfill('0') <<
- _e(static_cast<unsigned int>(_r[j])) << std::flush;
+ _e(static_cast<unsigned int>(j)) << std::flush;
return result.str();
}
diff --git a/paludis/util/pool.cc b/paludis/util/pool.cc
index 215629943..3332a24ac 100644
--- a/paludis/util/pool.cc
+++ b/paludis/util/pool.cc
@@ -86,11 +86,10 @@ PoolKeysHasher::operator() (const PoolKeys & keys) const
{
std::size_t result(0);
- for (auto i(keys._imp->values->begin()), i_end(keys._imp->values->end()) ;
- i != i_end ; ++i)
+ for (auto & i : *keys._imp->values)
{
result <<= 4;
- result ^= (*i)->hash();
+ result ^= i->hash();
}
return result;
diff --git a/paludis/util/process.cc b/paludis/util/process.cc
index 380d671d6..fa9bf8902 100644
--- a/paludis/util/process.cc
+++ b/paludis/util/process.cc
@@ -794,9 +794,8 @@ Process::run()
::setenv("LINES", stringify(lines).c_str(), 1);
}
- for (auto m(_imp->setenvs.begin()), m_end(_imp->setenvs.end()) ;
- m != m_end ; ++m)
- ::setenv(m->first.c_str(), m->second.c_str(), 1);
+ for (auto & m : _imp->setenvs)
+ ::setenv(m.first.c_str(), m.second.c_str(), 1);
if (! _imp->chdir.empty())
if (-1 == ::chdir(_imp->chdir.c_str()))
diff --git a/paludis/util/rmd160.cc b/paludis/util/rmd160.cc
index 394cf60c9..9e2f234c0 100644
--- a/paludis/util/rmd160.cc
+++ b/paludis/util/rmd160.cc
@@ -165,9 +165,9 @@ RMD160::hexsum() const
{
std::stringstream result;
- for (int j(0) ; j < 5 ; ++j)
+ for (unsigned int j : _h)
result << std::hex << std::right << std::setw(8) << std::setfill('0') <<
- _e(static_cast<unsigned int>(_h[j])) << std::flush;
+ _e(static_cast<unsigned int>(j)) << std::flush;
return result.str();
}
diff --git a/paludis/util/sha256.cc b/paludis/util/sha256.cc
index b44b11fe5..ca198ea9a 100644
--- a/paludis/util/sha256.cc
+++ b/paludis/util/sha256.cc
@@ -182,9 +182,9 @@ SHA256::hexsum() const
{
std::stringstream result;
- for (int j(0) ; j < 8 ; ++j)
+ for (unsigned int j : _h)
result << std::hex << std::right << std::setw(8) << std::setfill('0') <<
- static_cast<unsigned int>(_h[j]) << std::flush;
+ static_cast<unsigned int>(j) << std::flush;
return result.str();
}
diff --git a/paludis/util/tee_output_stream.cc b/paludis/util/tee_output_stream.cc
index 73b0ff1ad..d0ee0beb8 100644
--- a/paludis/util/tee_output_stream.cc
+++ b/paludis/util/tee_output_stream.cc
@@ -44,27 +44,24 @@ TeeOutputStreamBuf::~TeeOutputStreamBuf()
TeeOutputStreamBuf::int_type
TeeOutputStreamBuf::overflow(int_type c)
{
- for (std::list<std::ostream *>::iterator i(_imp->streams.begin()), i_end(_imp->streams.end()) ;
- i != i_end ; ++i)
- (*i)->put(c);
+ for (auto & stream : _imp->streams)
+ stream->put(c);
return c;
}
int
TeeOutputStreamBuf::sync()
{
- for (std::list<std::ostream *>::iterator i(_imp->streams.begin()), i_end(_imp->streams.end()) ;
- i != i_end ; ++i)
- **i << std::flush;
+ for (auto & stream : _imp->streams)
+ *stream << std::flush;
return 0;
}
std::streamsize
TeeOutputStreamBuf::xsputn(const char * s, std::streamsize num)
{
- for (std::list<std::ostream *>::iterator i(_imp->streams.begin()), i_end(_imp->streams.end()) ;
- i != i_end ; ++i)
- (*i)->write(s, num);
+ for (auto & stream : _imp->streams)
+ stream->write(s, num);
return num;
}
diff --git a/paludis/util/whirlpool.cc b/paludis/util/whirlpool.cc
index bbf4089cd..75ed86dee 100644
--- a/paludis/util/whirlpool.cc
+++ b/paludis/util/whirlpool.cc
@@ -455,8 +455,8 @@ Whirlpool::hexsum() const
{
std::stringstream result;
result << std::hex << std::right << std::setfill('0');
- for (int i = 0; i < 8; ++i)
- result << std::setw(16) << from_bigendian(H[i]);
+ for (unsigned long i : H)
+ result << std::setw(16) << from_bigendian(i);
return result.str();
}
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index 5b2fba576..a043fed8d 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -274,13 +274,12 @@ VersionSpec::VersionSpec(const std::string & text, const VersionSpecOptions & op
}
/* Now we can change empty values to "0" */
- for (Parts::iterator i(_imp->parts.begin()),
- i_end(_imp->parts.end()) ; i != i_end ; ++i)
- if ((*i).number_value().empty() &&
- (((*i).type() >= vsct_alpha && (*i).type() <= vsct_rc) ||
- (*i).type() == vsct_patch ||
- (*i).type() == vsct_trypart))
- (*i).number_value() = "0";
+ for (auto & part : _imp->parts)
+ if (part.number_value().empty() &&
+ ((part.type() >= vsct_alpha && part.type() <= vsct_rc) ||
+ part.type() == vsct_patch ||
+ part.type() == vsct_trypart))
+ part.number_value() = "0";
}
/* revision */
@@ -523,12 +522,11 @@ VersionSpec::hash() const
do
{
bool first(true);
- for (std::vector<VersionSpecComponent>::const_iterator r(_imp->parts.begin()), r_end(_imp->parts.end()) ;
- r != r_end ; ++r)
+ for (const auto & part : _imp->parts)
{
- if ((*r).number_value() == "0" && (*r).type() == vsct_revision)
+ if (part.number_value() == "0" && part.type() == vsct_revision)
continue;
- if ((*r).type() == vsct_ignore)
+ if (part.type() == vsct_ignore)
continue;
std::size_t hh(result & h_mask);
@@ -536,10 +534,10 @@ VersionSpec::hash() const
result ^= (hh >> h_shift);
std::string r_v;
- if ((*r).type() == vsct_floatlike)
- r_v = strip_trailing((*r).number_value(), "0");
+ if (part.type() == vsct_floatlike)
+ r_v = strip_trailing(part.number_value(), "0");
else
- r_v = (*r).number_value();
+ r_v = part.number_value();
size_t x(0);
int zeroes(0);
@@ -554,7 +552,7 @@ VersionSpec::hash() const
}
first = false;
- result ^= (static_cast<std::size_t>((*r).type()) + (x << 3) + (zeroes << 12));
+ result ^= (static_cast<std::size_t>(part.type()) + (x << 3) + (zeroes << 12));
}
} while (false);