aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 21:14:33 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 21:15:08 +0100
commit1e88d3f531a7d9cac4cd08db1484a3a87679af3c (patch)
tree9c2852177fbfc30366d24947658bf52a5c9e6d0c /paludis/repositories/virtuals
parentc3802f0aec7d89a518cf74145aa73bf2ea688e35 (diff)
downloadpaludis-1e88d3f531a7d9cac4cd08db1484a3a87679af3c.tar.gz
paludis-1e88d3f531a7d9cac4cd08db1484a3a87679af3c.tar.xz
Avoid more explicit newage
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc16
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc4
-rw-r--r--paludis/repositories/virtuals/package_id.cc12
-rw-r--r--paludis/repositories/virtuals/registration.cc6
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc15
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc20
6 files changed, 36 insertions, 37 deletions
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index cf6afff2a..d49a36cca 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -66,9 +66,9 @@ namespace paludis
root(r),
ids_mutex(m),
has_ids(false),
- root_key(new LiteralMetadataValueKey<FSEntry> (
+ root_key(std::make_shared<LiteralMetadataValueKey<FSEntry> >(
"root", "root", mkt_normal, root)),
- format_key(new LiteralMetadataValueKey<std::string> (
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "installed_virtuals"))
{
}
@@ -155,7 +155,7 @@ InstalledVirtualsRepository::need_ids() const
if (i == _imp->ids.end())
i = _imp->ids.insert(std::make_pair((*p).virtual_name(), std::make_shared<PackageIDSequence>())).first;
- std::shared_ptr<const PackageID> id(new virtuals::VirtualsPackageID(
+ std::shared_ptr<const PackageID> id(std::make_shared<virtuals::VirtualsPackageID>(
_imp->env, shared_from_this(), (*p).virtual_name(), (*p).provided_by(), false));
i->second->push_back(id);
}
@@ -168,13 +168,13 @@ std::shared_ptr<const PackageIDSequence>
InstalledVirtualsRepository::package_ids(const QualifiedPackageName & q) const
{
if (q.category().value() != "virtual")
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
return i->second;
}
@@ -183,11 +183,11 @@ std::shared_ptr<const QualifiedPackageNameSet>
InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
{
if (c.value() != "virtual")
- return std::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
+ return std::shared_ptr<QualifiedPackageNameSet>(std::make_shared<QualifiedPackageNameSet>());
need_ids();
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::transform(_imp->ids.begin(), _imp->ids.end(), result->inserter(),
std::mem_fn(&std::pair<const QualifiedPackageName, std::shared_ptr<PackageIDSequence> >::first));
@@ -197,7 +197,7 @@ InstalledVirtualsRepository::package_names(const CategoryNamePart & c) const
std::shared_ptr<const CategoryNamePartSet>
InstalledVirtualsRepository::category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc b/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
index 497819f4c..136472f4b 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -34,7 +34,7 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<const InstalledVirtualsRepository> r(new InstalledVirtualsRepository(&env, FSEntry("/")));
+ std::shared_ptr<const InstalledVirtualsRepository> r(std::make_shared<InstalledVirtualsRepository>(&env, FSEntry("/")));
}
} test_installed_virtuals_repository;
}
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index b6f617f78..1e02917d1 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -64,7 +64,7 @@ namespace paludis
const std::shared_ptr<const DependenciesLabelSequence> & l,
bool exact, const std::string & h, const std::string & r) :
env(e),
- value(new DependencySpecTree(std::make_shared<AllDepSpec>())),
+ value(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>())),
labels(l),
spec(exact ?
std::make_shared<PackageDepSpec>(
@@ -184,11 +184,11 @@ namespace paludis
repository(o),
name(n),
version(p->version()),
- bdep_labels(new DependenciesLabelSequence),
- rdep_labels(new DependenciesLabelSequence),
- virtual_for(new LiteralMetadataValueKey<std::shared_ptr<const PackageID> > ("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
- bdep(new virtuals::VirtualsDepKey(e, "DEPEND", "Build dependencies", p, bdep_labels, b)),
- rdep(new virtuals::VirtualsDepKey(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
+ bdep_labels(std::make_shared<DependenciesLabelSequence>()),
+ rdep_labels(std::make_shared<DependenciesLabelSequence>()),
+ virtual_for(std::make_shared<LiteralMetadataValueKey<std::shared_ptr<const PackageID> > >("VIRTUAL_FOR", "Virtual for", mkt_normal, p)),
+ bdep(std::make_shared<virtuals::VirtualsDepKey>(e, "DEPEND", "Build dependencies", p, bdep_labels, b)),
+ rdep(std::make_shared<virtuals::VirtualsDepKey>(e, "RDEPEND", "Run dependencies", p, rdep_labels, b)),
has_masks(false)
{
bdep_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
diff --git a/paludis/repositories/virtuals/registration.cc b/paludis/repositories/virtuals/registration.cc
index ad2feaebd..f9abb56e0 100644
--- a/paludis/repositories/virtuals/registration.cc
+++ b/paludis/repositories/virtuals/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -48,7 +48,7 @@ namespace paludis
void register_repositories<repository_groups::virtuals>(const repository_groups::virtuals * const,
RepositoryFactory * const factory)
{
- std::shared_ptr<Set<std::string> > virtuals_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > virtuals_formats(std::make_shared<Set<std::string>>());
virtuals_formats->insert("virtuals");
factory->add_repository_format(
@@ -59,7 +59,7 @@ namespace paludis
&VirtualsRepository::repository_factory_dependencies
);
- std::shared_ptr<Set<std::string> > installed_virtuals_formats(new Set<std::string>);
+ std::shared_ptr<Set<std::string> > installed_virtuals_formats(std::make_shared<Set<std::string>>());
installed_virtuals_formats->insert("installed_virtuals");
installed_virtuals_formats->insert("installed-virtuals");
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 0f5096030..f55b00366 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -76,8 +76,7 @@ namespace paludis
big_nasty_mutex(m),
has_names(false),
has_ids(false),
- format_key(new LiteralMetadataValueKey<std::string> (
- "format", "format", mkt_significant, "virtuals"))
+ format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "virtuals"))
{
}
};
@@ -163,7 +162,7 @@ VirtualsRepository::need_names() const
for (RepositoryProvidesInterface::ProvidesSequence::ConstIterator p(provides->begin()),
p_end(provides->end()) ; p != p_end ; ++p)
_imp->names.push_back(std::make_pair((*p).virtual_name(), std::shared_ptr<const PackageDepSpec>(
- new PackageDepSpec(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package((*p).provided_by()->name())))));
+ std::make_shared<PackageDepSpec>(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package((*p).provided_by()->name())))));
}
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
@@ -252,13 +251,13 @@ std::shared_ptr<const PackageIDSequence>
VirtualsRepository::package_ids(const QualifiedPackageName & q) const
{
if (q.category().value() != "virtual")
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
need_ids();
IDMap::const_iterator i(_imp->ids.find(q));
if (i == _imp->ids.end())
- return std::shared_ptr<PackageIDSequence>(new PackageIDSequence);
+ return std::shared_ptr<PackageIDSequence>(std::make_shared<PackageIDSequence>());
return i->second;
}
@@ -267,11 +266,11 @@ std::shared_ptr<const QualifiedPackageNameSet>
VirtualsRepository::package_names(const CategoryNamePart & c) const
{
if (c.value() != "virtual")
- return std::shared_ptr<QualifiedPackageNameSet>(new QualifiedPackageNameSet);
+ return std::shared_ptr<QualifiedPackageNameSet>(std::make_shared<QualifiedPackageNameSet>());
need_ids();
- std::shared_ptr<QualifiedPackageNameSet> result(new QualifiedPackageNameSet);
+ std::shared_ptr<QualifiedPackageNameSet> result(std::make_shared<QualifiedPackageNameSet>());
std::transform(_imp->ids.begin(), _imp->ids.end(), result->inserter(),
std::mem_fn(&std::pair<const QualifiedPackageName, std::shared_ptr<PackageIDSequence> >::first));
@@ -281,7 +280,7 @@ VirtualsRepository::package_names(const CategoryNamePart & c) const
std::shared_ptr<const CategoryNamePartSet>
VirtualsRepository::category_names() const
{
- std::shared_ptr<CategoryNamePartSet> result(new CategoryNamePartSet);
+ std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
result->insert(CategoryNamePart("virtual"));
return result;
}
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
index c2ba62b88..5d5525ae7 100644
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
@@ -49,12 +49,12 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- const std::shared_ptr<FakeRepository> repo(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
+ const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo")
)));
- std::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -92,16 +92,16 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- const std::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
+ const std::shared_ptr<FakeRepository> repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1")
)));
- const std::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2")
)));
- std::shared_ptr<FakeInstalledRepository> installed(new FakeInstalledRepository(
+ std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("installed"),
@@ -145,12 +145,12 @@ namespace test_cases
void run()
{
TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(new VirtualsRepository(&env));
- const std::shared_ptr<FakeRepository> repo1(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
+ const std::shared_ptr<FakeRepository> repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo1")
)));
- const std::shared_ptr<FakeRepository> repo2(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ const std::shared_ptr<FakeRepository> repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("repo2")
)));