summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-09-27 18:28:26 -0400
committerDavid Robillard <d@drobilla.net>2022-09-27 18:28:26 -0400
commit3ae3c86937c7ffc45d24e36a33560cd63ebb900b (patch)
tree94950d3132bf7408f0263c36723ed51849c42fd6
parentf8fefe7d8e417c29537e8c9fa7703107d69f66b5 (diff)
downloadingen-3ae3c86937c7ffc45d24e36a33560cd63ebb900b.tar.gz
ingen-3ae3c86937c7ffc45d24e36a33560cd63ebb900b.tar.bz2
ingen-3ae3c86937c7ffc45d24e36a33560cd63ebb900b.zip
Use std::make_unique
-rw-r--r--.clang-tidy1
-rw-r--r--src/ingen/ingen.cpp3
-rw-r--r--src/server/CompiledGraph.cpp3
-rw-r--r--src/server/PortAudioDriver.cpp3
-rw-r--r--src/server/Task.cpp3
-rw-r--r--src/server/Task.hpp2
-rw-r--r--tests/ingen_bench.cpp3
-rw-r--r--tests/ingen_test.cpp2
8 files changed, 9 insertions, 11 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 69353fab..01ee20da 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -20,7 +20,6 @@ Checks: >
-llvmlibc-*,
-misc-unused-parameters,
-modernize-concat-nested-namespaces,
- -modernize-make-unique,
-modernize-pass-by-value,
-modernize-return-braced-init-list,
-modernize-use-nodiscard,
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index b19e6423..06d990f2 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -99,8 +99,7 @@ run(int argc, char** argv)
{
// Create world
try {
- world = std::unique_ptr<ingen::World>(
- new ingen::World(nullptr, nullptr, nullptr));
+ world = std::make_unique<ingen::World>(nullptr, nullptr, nullptr);
world->load_configuration(argc, argv);
if (argc <= 1) {
world->conf().print_usage("ingen", std::cout);
diff --git a/src/server/CompiledGraph.cpp b/src/server/CompiledGraph.cpp
index 103d27a3..f03187ae 100644
--- a/src/server/CompiledGraph.cpp
+++ b/src/server/CompiledGraph.cpp
@@ -37,6 +37,7 @@
#include <cstdio>
#include <exception>
#include <limits>
+#include <memory>
#include <utility>
namespace ingen {
@@ -71,7 +72,7 @@ has_provider_with_many_dependants(const BlockImpl* n)
}
CompiledGraph::CompiledGraph(GraphImpl* graph)
- : _master(std::unique_ptr<Task>(new Task(Task::Mode::SEQUENTIAL)))
+ : _master{std::make_unique<Task>(Task::Mode::SEQUENTIAL)}
{
compile_graph(graph);
}
diff --git a/src/server/PortAudioDriver.cpp b/src/server/PortAudioDriver.cpp
index c04e83d9..c80b25f3 100644
--- a/src/server/PortAudioDriver.cpp
+++ b/src/server/PortAudioDriver.cpp
@@ -85,8 +85,7 @@ PortAudioDriver::attach()
_sample_rate = in_dev->defaultSampleRate;
- _timer = std::unique_ptr<FrameTimer>(
- new FrameTimer(_block_length, _sample_rate));
+ _timer = std::make_unique<FrameTimer>(_block_length, _sample_rate);
return true;
}
diff --git a/src/server/Task.cpp b/src/server/Task.cpp
index 43db78e8..089a2f46 100644
--- a/src/server/Task.cpp
+++ b/src/server/Task.cpp
@@ -22,6 +22,7 @@
#include "raul/Path.hpp"
#include <cstddef>
+#include <memory>
namespace ingen {
namespace server {
@@ -116,7 +117,7 @@ Task::simplify(std::unique_ptr<Task>&& task)
return std::move(task);
}
- std::unique_ptr<Task> ret = std::unique_ptr<Task>(new Task(task->mode()));
+ std::unique_ptr<Task> ret = std::make_unique<Task>(task->mode());
for (auto&& c : task->_children) {
auto child = simplify(std::move(c));
if (!child->empty()) {
diff --git a/src/server/Task.hpp b/src/server/Task.hpp
index b4e9848c..0a545655 100644
--- a/src/server/Task.hpp
+++ b/src/server/Task.hpp
@@ -90,7 +90,7 @@ public:
/** Prepend a child to this task. */
void push_front(Task&& task) {
- _children.emplace_front(std::unique_ptr<Task>(new Task(std::move(task))));
+ _children.emplace_front(std::make_unique<Task>(std::move(task)));
}
Mode mode() const { return _mode; }
diff --git a/tests/ingen_bench.cpp b/tests/ingen_bench.cpp
index 2af53f89..07a59f9b 100644
--- a/tests/ingen_bench.cpp
+++ b/tests/ingen_bench.cpp
@@ -62,8 +62,7 @@ run(int argc, char** argv)
{
// Create world
try {
- world = std::unique_ptr<ingen::World>{
- new ingen::World(nullptr, nullptr, nullptr)};
+ world = std::make_unique<ingen::World>(nullptr, nullptr, nullptr);
world->conf().add(
"output", "output", 'O', "File to write benchmark output",
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp
index 9f7da2f0..df7e9d34 100644
--- a/tests/ingen_test.cpp
+++ b/tests/ingen_test.cpp
@@ -78,7 +78,7 @@ run(int argc, char** argv)
{
// Create world
try {
- world = std::unique_ptr<World>{new World(nullptr, nullptr, nullptr)};
+ world = std::make_unique<World>(nullptr, nullptr, nullptr);
world->load_configuration(argc, argv);
} catch (std::exception& e) {
std::cout << "ingen: " << e.what() << std::endl;