From 4ca52683ce01f833c552aa62dd80a6a3e48e785c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Dec 2019 17:08:51 +0100 Subject: Cleanup: Use std::make_shared --- src/LV2Features.cpp | 3 ++- src/World.cpp | 10 +++++----- src/server/Engine.cpp | 2 +- src/server/GraphImpl.cpp | 2 +- src/server/events/Connect.cpp | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/LV2Features.cpp b/src/LV2Features.cpp index fe2304a2..048dc13f 100644 --- a/src/LV2Features.cpp +++ b/src/LV2Features.cpp @@ -79,7 +79,8 @@ LV2Features::lv2_features(World& world, Node* node) const vec.push_back(fptr); } } - return SPtr(new FeatureArray(vec)); + + return std::make_shared(vec); } } // namespace ingen diff --git a/src/World.cpp b/src/World.cpp index 69a0f0bc..72b7b96b 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -101,9 +101,9 @@ public: lv2_features = new LV2Features(); lv2_features->add_feature(uri_map.urid_map_feature()); lv2_features->add_feature(uri_map.urid_unmap_feature()); - lv2_features->add_feature(SPtr(new InstanceAccess())); - lv2_features->add_feature(SPtr(new DataAccess())); - lv2_features->add_feature(SPtr(new Log::Feature())); + lv2_features->add_feature(std::make_shared()); + lv2_features->add_feature(std::make_shared()); + lv2_features->add_feature(std::make_shared()); lilv_world_load_all(lilv_world.get()); // Set up RDF namespaces @@ -197,8 +197,8 @@ public: World::World(LV2_URID_Map* map, LV2_URID_Unmap* unmap, LV2_Log_Log* log) : _impl(new Impl(map, unmap, log)) { - _impl->serialiser = SPtr(new Serialiser(*this)); - _impl->parser = SPtr(new Parser()); + _impl->serialiser = std::make_shared(*this); + _impl->parser = std::make_shared(); } World::~World() diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index f93c7fe5..18feff1f 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -95,7 +95,7 @@ Engine::Engine(ingen::World& world) , _activated(false) { if (!world.store()) { - world.set_store(SPtr(new Store())); + world.set_store(std::make_shared()); } for (int i = 0; i < world.conf().option("threads").get(); ++i) { diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp index 75f4cc01..b0f6145a 100644 --- a/src/server/GraphImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -117,7 +117,7 @@ GraphImpl::duplicate(Engine& engine, auto t = port_map.find(arc->tail()); auto h = port_map.find(arc->head()); if (t != port_map.end() && h != port_map.end()) { - dup->add_arc(SPtr(new ArcImpl(t->second, h->second))); + dup->add_arc(std::make_shared(t->second, h->second)); } } } diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 1ce8f5a1..d27e1e3b 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -105,7 +105,7 @@ Connect::pre_process(PreProcessContext& ctx) return Event::pre_process_done(Status::EXISTS, _msg.head); } - _arc = SPtr(new ArcImpl(tail_output, _head)); + _arc = std::make_shared(tail_output, _head); /* Need to be careful about graph port arcs here and adding a block's parent as a dependant/provider, or adding a graph as its own -- cgit v1.2.1