aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/fake
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-22 12:52:10 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-22 18:55:26 +0100
commitf7be9952e67a5cdad6f3531a22654db198e7d106 (patch)
tree54c8fae2eaaf89851c038d28ed6deb9096c87b4d /paludis/repositories/fake
parent84f32a46c9bd03039af31be9626206ce891fa841 (diff)
downloadpaludis-f7be9952e67a5cdad6f3531a22654db198e7d106.tar.gz
paludis-f7be9952e67a5cdad6f3531a22654db198e7d106.tar.xz
Use std::make_shared<>
Diffstat (limited to 'paludis/repositories/fake')
-rw-r--r--paludis/repositories/fake/dep_parser.cc27
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc8
-rw-r--r--paludis/repositories/fake/fake_package_id.cc29
-rw-r--r--paludis/repositories/fake/fake_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc1
-rw-r--r--paludis/repositories/fake/registration.cc3
6 files changed, 34 insertions, 36 deletions
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index 973444a46..d2e3465b0 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -18,7 +18,6 @@
*/
#include <paludis/repositories/fake/dep_parser.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/options.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_named_values.hh>
@@ -58,7 +57,7 @@ namespace
+ epdso_strict_parsing,
user_version_spec_options(),
id));
- (*h.begin())->append(make_shared_ptr(new PackageDepSpec(p)));
+ (*h.begin())->append(std::make_shared<PackageDepSpec>(p));
}
template <typename T_>
@@ -67,14 +66,14 @@ namespace
{
if ((! s.empty()) && ('!' == s.at(0)))
{
- (*h.begin())->append(make_shared_ptr(new BlockDepSpec(s,
+ (*h.begin())->append(std::make_shared<BlockDepSpec>(s,
parse_elike_package_dep_spec(s.substr(1),
ELikePackageDepSpecOptions() + epdso_allow_slot_deps
+ epdso_allow_slot_star_deps + epdso_allow_slot_equal_deps + epdso_allow_repository_deps
+ epdso_allow_use_deps + epdso_allow_ranged_deps + epdso_allow_tilde_greater_deps
+ epdso_strict_parsing,
user_version_spec_options(),
- id), false)));
+ id), false));
}
else
package_dep_spec_string_handler<T_>(h, s, id);
@@ -83,19 +82,19 @@ namespace
template <typename T_>
void license_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())->append(make_shared_ptr(new LicenseDepSpec(s)));
+ (*h.begin())->append(std::make_shared<LicenseDepSpec>(s));
}
template <typename T_>
void simple_uri_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s)
{
- (*h.begin())->append(make_shared_ptr(new SimpleURIDepSpec(s)));
+ (*h.begin())->append(std::make_shared<SimpleURIDepSpec>(s));
}
template <typename T_>
void arrow_handler(const typename ParseStackTypes<T_>::Stack & h, const std::string & s, const std::string & t)
{
- (*h.begin())->append(make_shared_ptr(new FetchableURIDepSpec(t.empty() ? s : s + " -> " + t)));
+ (*h.begin())->append(std::make_shared<FetchableURIDepSpec>(t.empty() ? s : s + " -> " + t));
}
void any_not_allowed_handler(const std::string & s) PALUDIS_ATTRIBUTE((noreturn));
@@ -129,7 +128,7 @@ namespace
template <typename T_, typename A_>
void any_all_handler(typename ParseStackTypes<T_>::Stack & stack)
{
- stack.push_front((*stack.begin())->append(make_shared_ptr(new A_)));
+ stack.push_front((*stack.begin())->append(std::make_shared<A_>()));
}
template <typename T_>
@@ -137,7 +136,7 @@ namespace
const Environment * const env, const std::shared_ptr<const PackageID> & id)
{
stack.push_front((*stack.begin())->append(
- make_shared_ptr(new ConditionalDepSpec(parse_elike_conditional_dep_spec(u, env, id, false)))));
+ std::make_shared<ConditionalDepSpec>(parse_elike_conditional_dep_spec(u, env, id, false))));
}
template <typename T_>
@@ -171,7 +170,7 @@ paludis::fakerepository::parse_depend(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<DependencySpecTree>::Stack stack;
- std::shared_ptr<DependencySpecTree> top(make_shared_ptr(new DependencySpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<DependencySpecTree> top(std::make_shared<DependencySpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -201,7 +200,7 @@ paludis::fakerepository::parse_provide(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<ProvideSpecTree>::Stack stack;
- std::shared_ptr<ProvideSpecTree> top(make_shared_ptr(new ProvideSpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<ProvideSpecTree> top(std::make_shared<ProvideSpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -231,7 +230,7 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<FetchableURISpecTree>::Stack stack;
- std::shared_ptr<FetchableURISpecTree> top(make_shared_ptr(new FetchableURISpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<FetchableURISpecTree> top(std::make_shared<FetchableURISpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -261,7 +260,7 @@ paludis::fakerepository::parse_simple_uri(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<SimpleURISpecTree>::Stack stack;
- std::shared_ptr<SimpleURISpecTree> top(make_shared_ptr(new SimpleURISpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<SimpleURISpecTree> top(std::make_shared<SimpleURISpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
@@ -291,7 +290,7 @@ paludis::fakerepository::parse_license(const std::string & s,
using namespace std::placeholders;
ParseStackTypes<LicenseSpecTree>::Stack stack;
- std::shared_ptr<LicenseSpecTree> top(make_shared_ptr(new LicenseSpecTree(make_shared_ptr(new AllDepSpec))));
+ std::shared_ptr<LicenseSpecTree> top(std::make_shared<LicenseSpecTree>(std::make_shared<AllDepSpec>()));
stack.push_front(top->root());
ELikeDepParserCallbacks callbacks(
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 48f23a144..a13d7bcd4 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -21,8 +21,8 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
@@ -237,12 +237,12 @@ FakeInstalledRepository::repository_factory_create(
Context context("When creating FakeInstalledRepository:");
RepositoryName name(f("name"));
- return make_shared_ptr(new FakeInstalledRepository(make_named_values<FakeInstalledRepositoryParams>(
+ return std::make_shared<FakeInstalledRepository>(make_named_values<FakeInstalledRepositoryParams>(
n::environment() = env,
n::name() = name,
n::suitable_destination() = true,
n::supports_uninstall() = true
- )));
+ ));
}
std::shared_ptr<const RepositoryNameSet>
@@ -250,7 +250,7 @@ FakeInstalledRepository::repository_factory_dependencies(
const Environment * const,
const std::function<std::string (const std::string&)> &)
{
- return make_shared_ptr(new RepositoryNameSet);
+ return std::make_shared<RepositoryNameSet>();
}
const std::shared_ptr<const MetadataValueKey<std::string> >
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index ae2981b0c..db1ac5af2 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -40,6 +40,7 @@
#include <paludis/util/tribool.hh>
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/util/return_literal_function.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <map>
@@ -578,8 +579,8 @@ FakeMetadataChoicesKey::add(const std::string & n, const std::string & v)
_imp->choices.insert(std::make_pair(n, c));
}
- _imp->choices.find(n)->second->add(make_shared_ptr(new FakeChoiceValue(_imp->env, _imp->id,
- _imp->choices.find(n)->second, UnprefixedChoiceName(v))));
+ _imp->choices.find(n)->second->add(std::make_shared<FakeChoiceValue>(_imp->env, _imp->id,
+ _imp->choices.find(n)->second, UnprefixedChoiceName(v)));
}
const std::shared_ptr<const Choices>
@@ -733,14 +734,14 @@ namespace paludis
behaviours_set(new Set<std::string>),
has_masks(false)
{
- build_dependencies_labels->push_back(make_shared_ptr(new DependenciesBuildLabel("DEPEND",
- return_literal_function(true))));
- run_dependencies_labels->push_back(make_shared_ptr(new DependenciesRunLabel("RDEPEND",
- return_literal_function(true))));
- post_dependencies_labels->push_back(make_shared_ptr(new DependenciesPostLabel("PDEPEND",
- return_literal_function(true))));
- suggested_dependencies_labels->push_back(make_shared_ptr(new DependenciesSuggestionLabel("SDEPEND",
- return_literal_function(true))));
+ build_dependencies_labels->push_back(std::make_shared<DependenciesBuildLabel>("DEPEND",
+ return_literal_function(true)));
+ run_dependencies_labels->push_back(std::make_shared<DependenciesRunLabel>("RDEPEND",
+ return_literal_function(true)));
+ post_dependencies_labels->push_back(std::make_shared<DependenciesPostLabel>("PDEPEND",
+ return_literal_function(true)));
+ suggested_dependencies_labels->push_back(std::make_shared<DependenciesSuggestionLabel>("SDEPEND",
+ return_literal_function(true)));
}
};
}
@@ -1140,14 +1141,14 @@ FakePackageID::need_masks_added() const
if (keywords_key())
if (! _imp->env->accept_keywords(keywords_key()->value(), *this))
- add_mask(make_shared_ptr(new FakeUnacceptedMask('K', "keywords", keywords_key())));
+ add_mask(std::make_shared<FakeUnacceptedMask>('K', "keywords", keywords_key()));
if (license_key())
{
LicenceChecker c(_imp->env, &Environment::accept_license, this);
license_key()->value()->root()->accept(c);
if (! c.ok)
- add_mask(make_shared_ptr(new FakeUnacceptedMask('L', "license", license_key())));
+ add_mask(std::make_shared<FakeUnacceptedMask>('L', "license", license_key()));
}
if (! _imp->env->unmasked_by_user(*this))
@@ -1160,11 +1161,11 @@ FakePackageID::need_masks_added() const
{
std::shared_ptr<const Mask> user_mask(_imp->env->mask_for_user(*this, true));
if (user_mask)
- add_overridden_mask(make_shared_ptr(new OverriddenMask(
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
n::mask() = user_mask,
n::override_reason() = mro_overridden_by_user
- ))));
+ )));
}
std::shared_ptr<const Mask> breaks_mask(_imp->env->mask_for_breakage(*this));
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index a4273975b..d8e2d484e 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -21,10 +21,10 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index 692221e32..7ef36f1a6 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -22,7 +22,6 @@
#include <paludis/util/stringify.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/wrapped_output_iterator.hh>
diff --git a/paludis/repositories/fake/registration.cc b/paludis/repositories/fake/registration.cc
index 056b2ae23..afe87e926 100644
--- a/paludis/repositories/fake/registration.cc
+++ b/paludis/repositories/fake/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -19,7 +19,6 @@
#include <paludis/repository_factory.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/destringify.hh>
#include <paludis/util/set.hh>
#include <paludis/environment.hh>