summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-02 14:09:03 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 14:09:03 +0200
commit62f5c3124b991abe9b9423a4908ca076079d5327 (patch)
tree661304a2e5920c1c77f4ce61e4852cabdb250e5f /src/server
parent019eeff6a7d051427ad62a288f350e66471a0462 (diff)
downloadingen-62f5c3124b991abe9b9423a4908ca076079d5327.tar.gz
ingen-62f5c3124b991abe9b9423a4908ca076079d5327.tar.bz2
ingen-62f5c3124b991abe9b9423a4908ca076079d5327.zip
Use auto with pointer casts to remove redundancy
Diffstat (limited to 'src/server')
-rw-r--r--src/server/GraphImpl.cpp4
-rw-r--r--src/server/events/Copy.cpp2
-rw-r--r--src/server/ingen_lv2.cpp18
3 files changed, 12 insertions, 12 deletions
diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp
index a494293d..08c8ccc6 100644
--- a/src/server/GraphImpl.cpp
+++ b/src/server/GraphImpl.cpp
@@ -117,7 +117,7 @@ GraphImpl::duplicate(Engine& engine,
// Add duplicates of all arcs
for (const auto& a : _arcs) {
- SPtr<ArcImpl> arc = std::dynamic_pointer_cast<ArcImpl>(a.second);
+ auto arc = std::dynamic_pointer_cast<ArcImpl>(a.second);
if (arc) {
auto t = port_map.find(arc->tail());
auto h = port_map.find(arc->head());
@@ -288,7 +288,7 @@ GraphImpl::remove_arc(const PortImpl* tail, const PortImpl* dst_port)
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
auto i = _arcs.find(std::make_pair(tail, dst_port));
if (i != _arcs.end()) {
- SPtr<ArcImpl> arc = std::dynamic_pointer_cast<ArcImpl>(i->second);
+ auto arc = std::dynamic_pointer_cast<ArcImpl>(i->second);
_arcs.erase(i);
return arc;
} else {
diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp
index a49fa3e4..dbe57dc0 100644
--- a/src/server/events/Copy.cpp
+++ b/src/server/events/Copy.cpp
@@ -144,7 +144,7 @@ bool
Copy::engine_to_filesystem(PreProcessContext&)
{
// Ensure source is a graph
- SPtr<GraphImpl> graph = std::dynamic_pointer_cast<GraphImpl>(_old_block);
+ auto graph = std::dynamic_pointer_cast<GraphImpl>(_old_block);
if (!graph) {
return Event::pre_process_done(Status::BAD_OBJECT_TYPE, _msg.old_uri);
}
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index cc42b3ac..a50b5859 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -624,9 +624,9 @@ ingen_connect_port(LV2_Handle instance, uint32_t port, void* data)
{
using namespace ingen::server;
- auto* me = static_cast<IngenPlugin*>(instance);
- server::Engine* engine = static_cast<server::Engine*>(me->world->engine().get());
- const SPtr<LV2Driver>& driver = std::static_pointer_cast<LV2Driver>(engine->driver());
+ auto* me = static_cast<IngenPlugin*>(instance);
+ server::Engine* engine = static_cast<server::Engine*>(me->world->engine().get());
+ const auto driver = std::static_pointer_cast<LV2Driver>(engine->driver());
if (port < driver->ports().size()) {
driver->ports().at(port)->set_buffer(data);
} else {
@@ -637,9 +637,9 @@ ingen_connect_port(LV2_Handle instance, uint32_t port, void* data)
static void
ingen_activate(LV2_Handle instance)
{
- auto* me = static_cast<IngenPlugin*>(instance);
- SPtr<server::Engine> engine = std::static_pointer_cast<server::Engine>(me->world->engine());
- const SPtr<LV2Driver>& driver = std::static_pointer_cast<LV2Driver>(engine->driver());
+ auto* me = static_cast<IngenPlugin*>(instance);
+ auto engine = std::static_pointer_cast<server::Engine>(me->world->engine());
+ const auto driver = std::static_pointer_cast<LV2Driver>(engine->driver());
engine->activate();
me->main = make_unique<std::thread>(ingen_lv2_main, engine, driver);
}
@@ -647,9 +647,9 @@ ingen_activate(LV2_Handle instance)
static void
ingen_run(LV2_Handle instance, uint32_t sample_count)
{
- auto* me = static_cast<IngenPlugin*>(instance);
- SPtr<server::Engine> engine = std::static_pointer_cast<server::Engine>(me->world->engine());
- const SPtr<LV2Driver>& driver = std::static_pointer_cast<LV2Driver>(engine->driver());
+ auto* me = static_cast<IngenPlugin*>(instance);
+ auto engine = std::static_pointer_cast<server::Engine>(me->world->engine());
+ const auto driver = std::static_pointer_cast<LV2Driver>(engine->driver());
server::ThreadManager::set_flag(ingen::server::THREAD_PROCESS);
server::ThreadManager::set_flag(ingen::server::THREAD_IS_REAL_TIME);