diff options
author | David Robillard <d@drobilla.net> | 2019-12-08 17:08:51 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-08 20:59:06 +0100 |
commit | 4ca52683ce01f833c552aa62dd80a6a3e48e785c (patch) | |
tree | 3de2448e635799286265b3e74605bac51df957c0 /src | |
parent | 1953452f3dc0c919b17f6f1ee555f5642480db44 (diff) | |
download | ingen-4ca52683ce01f833c552aa62dd80a6a3e48e785c.tar.gz ingen-4ca52683ce01f833c552aa62dd80a6a3e48e785c.tar.bz2 ingen-4ca52683ce01f833c552aa62dd80a6a3e48e785c.zip |
Cleanup: Use std::make_shared
Diffstat (limited to 'src')
-rw-r--r-- | src/LV2Features.cpp | 3 | ||||
-rw-r--r-- | src/World.cpp | 10 | ||||
-rw-r--r-- | src/server/Engine.cpp | 2 | ||||
-rw-r--r-- | src/server/GraphImpl.cpp | 2 | ||||
-rw-r--r-- | src/server/events/Connect.cpp | 2 |
5 files changed, 10 insertions, 9 deletions
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<FeatureArray>(new FeatureArray(vec)); + + return std::make_shared<FeatureArray>(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<InstanceAccess>(new InstanceAccess())); - lv2_features->add_feature(SPtr<DataAccess>(new DataAccess())); - lv2_features->add_feature(SPtr<Log::Feature>(new Log::Feature())); + lv2_features->add_feature(std::make_shared<InstanceAccess>()); + lv2_features->add_feature(std::make_shared<DataAccess>()); + lv2_features->add_feature(std::make_shared<Log::Feature>()); 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<Serialiser>(new Serialiser(*this)); - _impl->parser = SPtr<Parser>(new Parser()); + _impl->serialiser = std::make_shared<Serialiser>(*this); + _impl->parser = std::make_shared<Parser>(); } 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<ingen::Store>(new Store())); + world.set_store(std::make_shared<ingen::Store>()); } for (int i = 0; i < world.conf().option("threads").get<int32_t>(); ++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<ArcImpl>(new ArcImpl(t->second, h->second))); + dup->add_arc(std::make_shared<ArcImpl>(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<ArcImpl>(new ArcImpl(tail_output, _head)); + _arc = std::make_shared<ArcImpl>(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 |