diff options
author | David Robillard <d@drobilla.net> | 2024-07-17 11:01:54 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-07-17 11:47:19 -0400 |
commit | 973db12fe33bab8e6efca80deca358b4998d5eb2 (patch) | |
tree | 6ae279e5edccdde1ebaf6de9aa4a2706b0a8ec4f /src/server | |
parent | e2bbec54b3b26173284754b786310fc7d8589ecc (diff) | |
download | ingen-973db12fe33bab8e6efca80deca358b4998d5eb2.tar.gz ingen-973db12fe33bab8e6efca80deca358b4998d5eb2.tar.bz2 ingen-973db12fe33bab8e6efca80deca358b4998d5eb2.zip |
Remove redundant casts
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/Buffer.cpp | 5 | ||||
-rw-r--r-- | src/server/PreProcessor.cpp | 4 | ||||
-rw-r--r-- | src/server/ThreadManager.hpp | 4 | ||||
-rw-r--r-- | src/server/events/Copy.cpp | 3 | ||||
-rw-r--r-- | src/server/events/Disconnect.cpp | 2 | ||||
-rw-r--r-- | src/server/events/DisconnectAll.cpp | 4 |
6 files changed, 10 insertions, 12 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index 394d3323..553ae92e 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -207,8 +207,7 @@ Buffer::port_data(PortType port_type, SampleCount offset) const void* Buffer::port_data(PortType port_type, SampleCount offset) const { - return const_cast<void*>( - const_cast<Buffer*>(this)->port_data(port_type, offset)); + return const_cast<Buffer*>(this)->port_data(port_type, offset); } #ifdef __SSE__ @@ -435,7 +434,7 @@ void* Buffer::aligned_alloc(size_t size) { #if USE_POSIX_MEMALIGN void* buf = nullptr; - if (!posix_memalign(static_cast<void**>(&buf), 16, size)) { + if (!posix_memalign(&buf, 16, size)) { memset(buf, 0, size); return buf; } diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp index f9d7ecb3..5d9d4660 100644 --- a/src/server/PreProcessor.cpp +++ b/src/server/PreProcessor.cpp @@ -150,7 +150,7 @@ PreProcessor::process(RunContext& ctx, PostProcessor& dest, size_t limit) } #endif - auto* next = static_cast<Event*>(last->next()); + auto* next = last->next(); last->next(nullptr); dest.append(ctx, head, last); @@ -242,7 +242,7 @@ PreProcessor::run() wait_for_block_state(BlockState::UNBLOCKED); } - back = static_cast<Event*>(ev->next()); + back = ev->next(); } } diff --git a/src/server/ThreadManager.hpp b/src/server/ThreadManager.hpp index 07a01c2b..2e0ad966 100644 --- a/src/server/ThreadManager.hpp +++ b/src/server/ThreadManager.hpp @@ -35,13 +35,13 @@ class INGEN_SERVER_API ThreadManager public: static void set_flag(ThreadFlag f) { #ifndef NDEBUG - flags = (static_cast<unsigned>(flags) | f); + flags |= static_cast<unsigned>(f); #endif } static void unset_flag(ThreadFlag f) { #ifndef NDEBUG - flags = (static_cast<unsigned>(flags) & (~f)); + flags &= ~static_cast<unsigned>(f); #endif } diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp index f6529da3..74398ea4 100644 --- a/src/server/events/Copy.cpp +++ b/src/server/events/Copy.cpp @@ -125,8 +125,7 @@ Copy::engine_to_engine(PreProcessContext& ctx) } // Create new block - if (!(_block = dynamic_cast<BlockImpl*>( - _old_block->duplicate(_engine, raul::Symbol(new_path.symbol()), _parent)))) { + if (!(_block = _old_block->duplicate(_engine, raul::Symbol(new_path.symbol()), _parent))) { return Event::pre_process_done(Status::INTERNAL_ERROR); } diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index e0db262a..bdb18ef9 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -168,7 +168,7 @@ Disconnect::pre_process(PreProcessContext& ctx) _impl = std::make_unique<Impl>(_engine, _graph, - dynamic_cast<PortImpl*>(tail), + tail, dynamic_cast<InputPort*>(head)); _compiled_graph = ctx.maybe_compile(*_graph); diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 5f0e9a5e..87df61a5 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -112,7 +112,7 @@ DisconnectAll::pre_process(PreProcessContext& ctx) _impls.push_back( new Disconnect::Impl(_engine, _parent, - dynamic_cast<PortImpl*>(a->tail()), + a->tail(), dynamic_cast<InputPort*>(a->head()))); } @@ -123,7 +123,7 @@ DisconnectAll::pre_process(PreProcessContext& ctx) _impls.push_back( new Disconnect::Impl(_engine, parent_parent, - dynamic_cast<PortImpl*>(a->tail()), + a->tail(), dynamic_cast<InputPort*>(a->head()))); } } |