diff options
author | David Robillard <d@drobilla.net> | 2020-08-01 16:46:54 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-02 01:48:48 +0200 |
commit | 95ceaf902f95baa431cdda972c0ebb48293e2022 (patch) | |
tree | cb4b6ba1e36c3da09baec85475d118cb523b32c1 | |
parent | 8a7cc98bd39e95fbdab7bbb8e3e6e4aa351c219b (diff) | |
download | ingen-95ceaf902f95baa431cdda972c0ebb48293e2022.tar.gz ingen-95ceaf902f95baa431cdda972c0ebb48293e2022.tar.bz2 ingen-95ceaf902f95baa431cdda972c0ebb48293e2022.zip |
Use std::make_shared
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | ingen/InstanceAccess.hpp | 7 | ||||
-rw-r--r-- | src/client/ClientStore.cpp | 6 | ||||
-rw-r--r-- | src/gui/App.cpp | 14 | ||||
-rw-r--r-- | src/gui/GraphView.cpp | 3 | ||||
-rw-r--r-- | src/server/LV2Block.cpp | 1 | ||||
-rw-r--r-- | src/server/events/Connect.cpp | 1 |
7 files changed, 19 insertions, 14 deletions
diff --git a/.clang-tidy b/.clang-tidy index 1722ecfb..49c7b51d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -54,7 +54,6 @@ Checks: > -llvm-header-guard, -llvm-namespace-comment, -misc-unused-parameters, - -modernize-make-shared, -modernize-redundant-void-arg, -modernize-use-default-member-init, -modernize-use-trailing-return-type, diff --git a/ingen/InstanceAccess.hpp b/ingen/InstanceAccess.hpp index 52b48b3f..5d068ae1 100644 --- a/ingen/InstanceAccess.hpp +++ b/ingen/InstanceAccess.hpp @@ -25,6 +25,7 @@ #include "lilv/lilv.h" #include "lv2/core/lv2.h" +#include <memory> #include <utility> namespace ingen { @@ -44,9 +45,9 @@ struct InstanceAccess : public ingen::LV2Features::Feature return SPtr<LV2_Feature>(); } - return SPtr<LV2_Feature>( - new LV2_Feature{ "http://lv2plug.in/ns/ext/instance-access", - lilv_instance_get_handle(instance) }); + return std::make_shared<LV2_Feature>( + LV2_Feature{"http://lv2plug.in/ns/ext/instance-access", + lilv_instance_get_handle(instance)}); } }; diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 279d0cc6..74b307a5 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -315,8 +315,10 @@ ClientStore::operator()(const Put& msg) p->second.type() == _uris.forge.URID)) { const URI uri(_uris.forge.str(p->second, false)); if (!(plug = _plugin(uri))) { - plug = SPtr<PluginModel>( - new PluginModel(uris(), uri, Atom(), Properties())); + plug = std::make_shared<PluginModel>(uris(), + uri, + Atom(), + Properties()); add_plugin(plug); } diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 49ac2cae..49e3bb67 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -171,18 +171,18 @@ App::attach(const SPtr<ingen::Interface>& client) } _client = client; - _store = SPtr<ClientStore>(new ClientStore(_world.uris(), _world.log(), sig_client())); - _loader = SPtr<ThreadedLoader>(new ThreadedLoader(*this, _world.interface())); + _store = std::make_shared<ClientStore>(_world.uris(), _world.log(), sig_client()); + _loader = std::make_shared<ThreadedLoader>(*this, _world.interface()); if (!_world.store()) { _world.set_store(_store); } if (_world.conf().option("dump").get<int32_t>()) { - _dumper = SPtr<StreamWriter>(new StreamWriter(_world.uri_map(), - _world.uris(), - URI("ingen:/client"), - stderr, - ColorContext::Color::CYAN)); + _dumper = std::make_shared<StreamWriter>(_world.uri_map(), + _world.uris(), + URI("ingen:/client"), + stderr, + ColorContext::Color::CYAN); sig_client()->signal_message().connect( sigc::mem_fun(*_dumper.get(), &StreamWriter::message)); diff --git a/src/gui/GraphView.cpp b/src/gui/GraphView.cpp index 4f76f798..c9191a37 100644 --- a/src/gui/GraphView.cpp +++ b/src/gui/GraphView.cpp @@ -27,6 +27,7 @@ #include <cassert> #include <fstream> +#include <memory> namespace ingen { @@ -70,7 +71,7 @@ GraphView::set_graph(const SPtr<const GraphModel>& graph) assert(_breadcrumb_container); // ensure created _graph = graph; - _canvas = SPtr<GraphCanvas>(new GraphCanvas(*_app, graph, 1600*2, 1200*2)); + _canvas = std::make_shared<GraphCanvas>(*_app, graph, 1600*2, 1200*2); _canvas->build(); _canvas_scrolledwindow->add(_canvas->widget()); diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index 99f846a4..d82ef595 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -41,6 +41,7 @@ #include <cassert> #include <cmath> #include <cstdint> +#include <memory> #include <string> #include <utility> diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index dd5b32a9..2df73b21 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -31,6 +31,7 @@ #include "raul/Maid.hpp" #include <cassert> +#include <memory> #include <mutex> #include <utility> |