aboutsummaryrefslogtreecommitdiff
path: root/python
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 /python
parent84f32a46c9bd03039af31be9626206ce891fa841 (diff)
downloadpaludis-f7be9952e67a5cdad6f3531a22654db198e7d106.tar.gz
paludis-f7be9952e67a5cdad6f3531a22654db198e7d106.tar.xz
Use std::make_shared<>
Diffstat (limited to 'python')
-rw-r--r--python/action.cc8
-rw-r--r--python/dep_spec.cc57
-rw-r--r--python/environment.cc6
-rw-r--r--python/mask.cc5
-rw-r--r--python/metadata_key.cc1
-rw-r--r--python/repository.cc4
6 files changed, 39 insertions, 42 deletions
diff --git a/python/action.cc b/python/action.cc
index 23f8ff21b..69e322df9 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -22,9 +22,9 @@
#include <paludis/action.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/return_literal_function.hh>
+#include <paludis/util/make_null_shared_ptr.hh>
#include <paludis/standard_output_manager.hh>
#include <paludis/repository.hh>
#include <memory>
@@ -60,7 +60,7 @@ namespace
std::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
void cannot_perform_uninstall(const std::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
@@ -80,7 +80,7 @@ namespace
n::destination() = r,
n::make_output_manager() = &make_standard_output_manager,
n::perform_uninstall() = &cannot_perform_uninstall,
- n::replacing() = make_shared_ptr(new PackageIDSequence),
+ n::replacing() = std::make_shared<PackageIDSequence>(),
n::want_phase() = &want_all_phases
));
}
@@ -130,7 +130,7 @@ namespace
parts += fp_unneeded;
return new FetchActionOptions(make_named_values<FetchActionOptions>(
- n::errors() = make_shared_ptr(new Sequence<FetchActionFailure>),
+ n::errors() = std::make_shared<Sequence<FetchActionFailure>>(),
n::exclude_unmirrorable() = exclude_unmirrorable,
n::fetch_parts() = parts,
n::ignore_not_in_manifest() = false,
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 94c53470c..d1b336521 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -30,7 +30,6 @@
#include <paludis/version_requirements.hh>
#include <paludis/util/save.hh>
#include <paludis/util/stringify.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/clone-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -219,7 +218,7 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PackageDepSpec & p) :
deep_copy(p.package_ptr()),
deep_copy(p.category_name_part_ptr()),
deep_copy(p.package_name_part_ptr()),
- make_shared_ptr(new VersionRequirements),
+ std::make_shared<VersionRequirements>(),
p.version_requirements_mode(),
p.slot_requirement_ptr(),
deep_copy(p.in_repository_ptr()),
@@ -241,7 +240,7 @@ PythonPackageDepSpec::PythonPackageDepSpec(const PythonPackageDepSpec & p) :
deep_copy(p.package_ptr()),
deep_copy(p.category_name_part_ptr()),
deep_copy(p.package_name_part_ptr()),
- make_shared_ptr(new VersionRequirements),
+ std::make_shared<VersionRequirements>(),
p.version_requirements_mode(),
p.slot_requirement_ptr(),
deep_copy(p.in_repository_ptr()),
@@ -302,7 +301,7 @@ PythonPackageDepSpec::operator PackageDepSpec() const
PythonPackageDepSpec::operator std::shared_ptr<PackageDepSpec>() const
{
- return make_shared_ptr(new PackageDepSpec(*this));
+ return std::make_shared<PackageDepSpec>(*this);
}
std::shared_ptr<const QualifiedPackageName>
@@ -445,7 +444,7 @@ PythonBlockDepSpec::PythonBlockDepSpec(const std::string & t, const std::shared_
PythonBlockDepSpec::PythonBlockDepSpec(const BlockDepSpec & d) :
PythonStringDepSpec(d.text()),
- _spec(make_shared_ptr(new PythonPackageDepSpec(d.blocking()))),
+ _spec(std::make_shared<PythonPackageDepSpec>(d.blocking())),
_strong(d.strong())
{
}
@@ -557,61 +556,61 @@ SpecTreeToPython::visit(const GenericSpecTree::NodeType<ConditionalDepSpec>::Typ
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonPackageDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonPackageDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonPlainTextDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonPlainTextDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonNamedSetDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonNamedSetDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonLicenseDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonLicenseDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonSimpleURIDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonSimpleURIDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonFetchableURIDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonFetchableURIDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonBlockDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonBlockDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonURILabelsDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonURILabelsDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonPlainTextLabelDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonPlainTextLabelDepSpec>(*node.spec()));
}
void
SpecTreeToPython::visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- _current_parent->add_child(make_shared_ptr(new PythonDependenciesLabelsDepSpec(*node.spec())));
+ _current_parent->add_child(std::make_shared<PythonDependenciesLabelsDepSpec>(*node.spec()));
}
const std::shared_ptr<const PythonDepSpec>
@@ -730,7 +729,7 @@ void dispatch(SpecTreeFromPython<H_> * const v, const PyD_ & d)
template <typename H_>
SpecTreeFromPython<H_>::SpecTreeFromPython() :
- _result(new H_(make_shared_ptr(new AllDepSpec))),
+ _result(new H_(std::make_shared<AllDepSpec>())),
_add_to(_result->root())
{
}
@@ -835,7 +834,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonAllDepSpec & d)
{
- Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(make_shared_ptr(new AllDepSpec())));
+ Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(std::make_shared<AllDepSpec>()));
std::for_each(indirect_iterator(d.begin()), indirect_iterator(d.end()), accept_visitor(*this));
}
@@ -843,7 +842,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonAnyDepSpec & d)
{
- Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(make_shared_ptr(new AnyDepSpec())));
+ Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(std::make_shared<AnyDepSpec>()));
std::for_each(indirect_iterator(d.begin()), indirect_iterator(d.end()), accept_visitor(*this));
}
@@ -851,7 +850,7 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonConditionalDepSpec & d)
{
- Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(make_shared_ptr(new ConditionalDepSpec(d.data()))));
+ Save<std::shared_ptr<typename H_::BasicInnerNode> > old_add_to(&_add_to, _add_to->append(std::make_shared<ConditionalDepSpec>(d.data())));
std::for_each(indirect_iterator(d.begin()), indirect_iterator(d.end()), accept_visitor(*this));
}
@@ -859,70 +858,70 @@ template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonPackageDepSpec & d)
{
- _add_to->append(make_shared_ptr(new PackageDepSpec(d)));
+ _add_to->append(std::make_shared<PackageDepSpec>(d));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonLicenseDepSpec & d)
{
- _add_to->append(make_shared_ptr(new LicenseDepSpec(d.text())));
+ _add_to->append(std::make_shared<LicenseDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonSimpleURIDepSpec & d)
{
- _add_to->append(make_shared_ptr(new SimpleURIDepSpec(d.text())));
+ _add_to->append(std::make_shared<SimpleURIDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonPlainTextDepSpec & d)
{
- _add_to->append(make_shared_ptr(new PlainTextDepSpec(d.text())));
+ _add_to->append(std::make_shared<PlainTextDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonNamedSetDepSpec & d)
{
- _add_to->append(make_shared_ptr(new NamedSetDepSpec(d.name())));
+ _add_to->append(std::make_shared<NamedSetDepSpec>(d.name()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonFetchableURIDepSpec & d)
{
- _add_to->append(make_shared_ptr(new FetchableURIDepSpec(d.text())));
+ _add_to->append(std::make_shared<FetchableURIDepSpec>(d.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonURILabelsDepSpec &)
{
- _add_to->append(make_shared_ptr(new URILabelsDepSpec));
+ _add_to->append(std::make_shared<URILabelsDepSpec>());
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonPlainTextLabelDepSpec & s)
{
- _add_to->append(make_shared_ptr(new PlainTextLabelDepSpec(s.text())));
+ _add_to->append(std::make_shared<PlainTextLabelDepSpec>(s.text()));
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonDependenciesLabelsDepSpec &)
{
- _add_to->append(make_shared_ptr(new DependenciesLabelsDepSpec));
+ _add_to->append(std::make_shared<DependenciesLabelsDepSpec>());
}
template <typename H_>
void
SpecTreeFromPython<H_>::real_visit(const PythonBlockDepSpec & d)
{
- _add_to->append(make_shared_ptr(new BlockDepSpec(d.text(), *d.blocking(), d.strong())));
+ _add_to->append(std::make_shared<BlockDepSpec>(d.text(), *d.blocking(), d.strong()));
}
template <typename H_>
diff --git a/python/environment.cc b/python/environment.cc
index 18e5deb86..8be1aefac 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -33,8 +33,8 @@
#include <paludis/spec_tree.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/tribool.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/standard_output_manager.hh>
using namespace paludis;
@@ -435,7 +435,7 @@ class EnvironmentImplementationWrapper :
virtual const std::shared_ptr<OutputManager> create_output_manager(
const CreateOutputManagerInfo &) const
{
- return make_shared_ptr(new StandardOutputManager);
+ return std::make_shared<StandardOutputManager>();
}
virtual const std::shared_ptr<Repository> repository_from_new_config_file(
@@ -712,7 +712,7 @@ void expose_environment()
bp::init<const FSEntry &, const FSEntry &, const std::string &, const std::shared_ptr<const FSEntrySequence> &>(
(bp::arg("environment_dir"), bp::arg("write_cache_dir")="/var/empty",
bp::arg("master_repository_name")="",
- bp::arg("extra_repository_dirs") = make_shared_ptr(new FSEntrySequence)),
+ bp::arg("extra_repository_dirs") = std::make_shared<FSEntrySequence>()),
"__init__(environment_dir, write_cache_dir=\"/var/empty\", "
"master_repository_name=\"\", extra_repository_dirs=[])"
)
diff --git a/python/mask.cc b/python/mask.cc
index c25eac36b..3228042d6 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -22,7 +22,6 @@
#include <paludis/mask.hh>
#include <paludis/util/make_named_values.hh>
-#include <paludis/util/make_shared_ptr.hh>
using namespace paludis;
using namespace paludis::python;
@@ -33,10 +32,10 @@ namespace
std::shared_ptr<RepositoryMaskInfo> make_repository_mask_info(
const std::shared_ptr<const Sequence<std::string> > & s, const FSEntry & f)
{
- return make_shared_ptr(new RepositoryMaskInfo(make_named_values<RepositoryMaskInfo>(
+ return std::make_shared<RepositoryMaskInfo>(make_named_values<RepositoryMaskInfo>(
n::comment() = s,
n::mask_file() = f
- )));
+ ));
}
}
diff --git a/python/metadata_key.cc b/python/metadata_key.cc
index 2ce58a17d..f5afd796d 100644
--- a/python/metadata_key.cc
+++ b/python/metadata_key.cc
@@ -27,7 +27,6 @@
#include <paludis/environment.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/set.hh>
-#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/timestamp.hh>
diff --git a/python/repository.cc b/python/repository.cc
index c40be49a2..5fd1961c1 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -106,10 +106,10 @@ namespace
std::shared_ptr<FakeRepository>
make_fake_repository(const Environment * const env, const RepositoryName & n)
{
- return make_shared_ptr(new FakeRepository(make_named_values<FakeRepositoryParams>(
+ return std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
n::environment() = env,
n::name() = n
- )));
+ ));
}
}