summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 15:20:45 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit4ef41be9596cf997cd80175cfc7de2074a182d0d (patch)
tree33388d991953b7d1fae5a953e0fa08b545e99a41 /src/server
parentdbb38be5ccda387ef458583b5a85c03b59a5e05c (diff)
downloadingen-4ef41be9596cf997cd80175cfc7de2074a182d0d.tar.gz
ingen-4ef41be9596cf997cd80175cfc7de2074a182d0d.tar.bz2
ingen-4ef41be9596cf997cd80175cfc7de2074a182d0d.zip
Use auto with casts and allocations to remove redundancy
Diffstat (limited to 'src/server')
-rw-r--r--src/server/BlockImpl.hpp6
-rw-r--r--src/server/Buffer.cpp6
-rw-r--r--src/server/CompiledGraph.cpp24
-rw-r--r--src/server/JackDriver.cpp16
-rw-r--r--src/server/LV2Options.hpp2
-rw-r--r--src/server/PortAudioDriver.cpp4
-rw-r--r--src/server/UndoStack.hpp2
-rw-r--r--src/server/ingen_jack.cpp6
-rw-r--r--src/server/ingen_lv2.cpp37
-rw-r--r--src/server/ingen_portaudio.cpp2
-rw-r--r--src/server/internals/Controller.cpp9
-rw-r--r--src/server/internals/Note.cpp7
-rw-r--r--src/server/internals/Time.cpp4
-rw-r--r--src/server/internals/Trigger.cpp13
-rw-r--r--src/server/mix.cpp4
15 files changed, 73 insertions, 69 deletions
diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp
index 54fcd221..9bf3cac9 100644
--- a/src/server/BlockImpl.hpp
+++ b/src/server/BlockImpl.hpp
@@ -145,10 +145,12 @@ public:
virtual PortImpl* port_by_symbol(const char* symbol);
/** Blocks that are connected to this Block's inputs. */
- std::set<BlockImpl*>& providers() { return _providers; }
+ std::set<BlockImpl*>& providers() { return _providers; }
+ const std::set<BlockImpl*>& providers() const { return _providers; }
/** Blocks that are connected to this Block's outputs. */
- std::set<BlockImpl*>& dependants() { return _dependants; }
+ std::set<BlockImpl*>& dependants() { return _dependants; }
+ const std::set<BlockImpl*>& dependants() const { return _dependants; }
/** Flag block as polyphonic.
*
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 509cbc01..5df57ce7 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -333,8 +333,10 @@ Buffer::append_event(int64_t frames, const LV2_Atom* body)
bool
Buffer::append_event_buffer(const Buffer* buf)
{
- auto* seq = reinterpret_cast<LV2_Atom_Sequence*>(get<LV2_Atom>());
- auto* bseq = reinterpret_cast<const LV2_Atom_Sequence*>(buf->get<LV2_Atom>());
+ auto* seq = reinterpret_cast<LV2_Atom_Sequence*>(get<LV2_Atom>());
+ const auto* bseq =
+ reinterpret_cast<const LV2_Atom_Sequence*>(buf->get<LV2_Atom>());
+
if (seq->atom.type == _factory.uris().atom_Chunk) {
clear(); // Chunk initialized with prepare_output_write(), clear
}
diff --git a/src/server/CompiledGraph.cpp b/src/server/CompiledGraph.cpp
index 9efed05f..b9841191 100644
--- a/src/server/CompiledGraph.cpp
+++ b/src/server/CompiledGraph.cpp
@@ -49,9 +49,9 @@ public:
};
static bool
-has_provider_with_many_dependants(BlockImpl* n)
+has_provider_with_many_dependants(const BlockImpl* n)
{
- for (BlockImpl* p : n->providers()) {
+ for (const auto* p : n->providers()) {
if (p->dependants().size() > 1) {
return true;
}
@@ -84,10 +84,10 @@ CompiledGraph::compile(Raul::Maid& maid, GraphImpl& graph)
}
static size_t
-num_unvisited_dependants(BlockImpl* block)
+num_unvisited_dependants(const BlockImpl* block)
{
size_t count = 0;
- for (BlockImpl* b : block->dependants()) {
+ for (const BlockImpl* b : block->dependants()) {
if (b->get_mark() == BlockImpl::Mark::UNVISITED) {
++count;
}
@@ -96,14 +96,14 @@ num_unvisited_dependants(BlockImpl* block)
}
static size_t
-parallel_depth(BlockImpl* block)
+parallel_depth(const BlockImpl* block)
{
if (has_provider_with_many_dependants(block)) {
return 2;
}
size_t min_provider_depth = std::numeric_limits<size_t>::max();
- for (auto p : block->providers()) {
+ for (const auto* p : block->providers()) {
min_provider_depth = std::min(min_provider_depth, parallel_depth(p));
}
@@ -133,12 +133,12 @@ CompiledGraph::compile_graph(GraphImpl* graph)
// Calculate maximum sequential depth to consume this phase
size_t depth = std::numeric_limits<size_t>::max();
- for (auto i : blocks) {
+ for (const auto* i : blocks) {
depth = std::min(depth, parallel_depth(i));
}
Task par(Task::Mode::PARALLEL);
- for (auto b : blocks) {
+ for (auto* b : blocks) {
assert(num_unvisited_dependants(b) == 0);
Task seq(Task::Mode::SEQUENTIAL);
compile_block(b, seq, depth, predecessors);
@@ -164,7 +164,7 @@ check_feedback(const BlockImpl* root, BlockImpl* provider)
throw FeedbackException(root);
}
- for (auto p : provider->providers()) {
+ for (auto* p : provider->providers()) {
const BlockImpl::Mark mark = p->get_mark();
switch (mark) {
case BlockImpl::Mark::UNVISITED:
@@ -227,12 +227,12 @@ CompiledGraph::compile_block(BlockImpl* n,
if (n->providers().size() < 2) {
// Single provider, prepend it to this sequential task
- for (auto p : n->providers()) {
+ for (auto* p : n->providers()) {
compile_provider(n, p, task, max_depth - 1, k);
}
} else if (has_provider_with_many_dependants(n)) {
// Stop recursion and enqueue providers for the next round
- for (auto p : n->providers()) {
+ for (auto* p : n->providers()) {
if (num_unvisited_dependants(p) == 0) {
k.insert(p);
}
@@ -241,7 +241,7 @@ CompiledGraph::compile_block(BlockImpl* n,
// Multiple providers with only this node as dependant,
// make a new parallel task to execute them
Task par(Task::Mode::PARALLEL);
- for (auto p : n->providers()) {
+ for (auto* p : n->providers()) {
compile_provider(n, p, par, max_depth - 1, k);
}
task.push_front(std::move(par));
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 6209174f..d57b208a 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -225,7 +225,7 @@ JackDriver::add_port(RunContext& context, EnginePort* port)
DuplexPort* graph_port = port->graph_port();
if (graph_port->is_a(PortType::AUDIO) || graph_port->is_a(PortType::CV)) {
const SampleCount nframes = context.nframes();
- jack_port_t* jport = static_cast<jack_port_t*>(port->handle());
+ auto* jport = static_cast<jack_port_t*>(port->handle());
void* jbuf = jack_port_get_buffer(jport, nframes);
/* Jack fails to return a buffer if this is too soon after registering
@@ -301,7 +301,7 @@ JackDriver::port_property(const Raul::Path& path,
#ifdef HAVE_JACK_METADATA
EnginePort* eport = get_port(path);
if (eport) {
- const jack_port_t* const jport =
+ const auto* const jport =
static_cast<const jack_port_t*>(eport->handle());
port_property_internal(jport, uri, value);
@@ -357,7 +357,7 @@ JackDriver::pre_process_port(RunContext& context, EnginePort* port)
{
const URIs& uris = context.engine().world().uris();
const SampleCount nframes = context.nframes();
- jack_port_t* jack_port = static_cast<jack_port_t*>(port->handle());
+ auto* jack_port = static_cast<jack_port_t*>(port->handle());
DuplexPort* graph_port = port->graph_port();
Buffer* graph_buf = graph_port->buffer(0).get();
void* jack_buf = jack_port_get_buffer(jack_port, nframes);
@@ -392,7 +392,7 @@ JackDriver::post_process_port(RunContext& context, EnginePort* port) const
{
const URIs& uris = context.engine().world().uris();
const SampleCount nframes = context.nframes();
- jack_port_t* jack_port = static_cast<jack_port_t*>(port->handle());
+ auto* jack_port = static_cast<jack_port_t*>(port->handle());
DuplexPort* graph_port = port->graph_port();
void* jack_buf = port->buffer();
@@ -405,12 +405,12 @@ JackDriver::post_process_port(RunContext& context, EnginePort* port) const
if (graph_port->buffer_type() == uris.atom_Sequence) {
// Copy LV2 MIDI events to Jack MIDI buffer
- Buffer* const graph_buf = graph_port->buffer(0).get();
- LV2_Atom_Sequence* seq = graph_buf->get<LV2_Atom_Sequence>();
+ Buffer* const graph_buf = graph_port->buffer(0).get();
+ auto* seq = graph_buf->get<LV2_Atom_Sequence>();
jack_midi_clear_buffer(jack_buf);
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
- const uint8_t* buf =
+ const auto* buf =
static_cast<const uint8_t*>(LV2_ATOM_BODY(&ev->body));
if (ev->body.type == this->_midi_event_type) {
@@ -474,7 +474,7 @@ JackDriver::append_time_events(RunContext& context,
}
// Append position to buffer at offset 0 (start of this cycle)
- LV2_Atom* lpos = static_cast<LV2_Atom*>(pos_buf);
+ auto* lpos = static_cast<LV2_Atom*>(pos_buf);
buffer.append_event(0,
lpos->size,
lpos->type,
diff --git a/src/server/LV2Options.hpp b/src/server/LV2Options.hpp
index 852a30a5..38082b8d 100644
--- a/src/server/LV2Options.hpp
+++ b/src/server/LV2Options.hpp
@@ -51,7 +51,7 @@ public:
{ LV2_OPTIONS_INSTANCE, 0, 0, 0, 0, nullptr }
};
- LV2_Feature* f = static_cast<LV2_Feature*>(malloc(sizeof(LV2_Feature)));
+ auto* f = static_cast<LV2_Feature*>(malloc(sizeof(LV2_Feature)));
f->URI = LV2_OPTIONS__options;
f->data = malloc(sizeof(options));
memcpy(f->data, options, sizeof(options));
diff --git a/src/server/PortAudioDriver.cpp b/src/server/PortAudioDriver.cpp
index de8c36cb..8d4a4c63 100644
--- a/src/server/PortAudioDriver.cpp
+++ b/src/server/PortAudioDriver.cpp
@@ -243,12 +243,12 @@ PortAudioDriver::pre_process_port(RunContext& context,
}
if (port->is_input()) {
- const float* const* const ins =
+ const auto* const* const ins =
static_cast<const float* const*>(inputs);
port->set_buffer(const_cast<float*>(ins[port->driver_index()]));
} else {
- float* const* const outs = static_cast<float* const*>(inputs);
+ auto* const* const outs = static_cast<float* const*>(inputs);
port->set_buffer(outs[port->driver_index()]);
memset(port->buffer(), 0, _block_length * sizeof(float));
diff --git a/src/server/UndoStack.hpp b/src/server/UndoStack.hpp
index 92f32131..26334aeb 100644
--- a/src/server/UndoStack.hpp
+++ b/src/server/UndoStack.hpp
@@ -71,7 +71,7 @@ public:
void push_event(const LV2_Atom* ev) {
const uint32_t size = lv2_atom_total_size(ev);
- LV2_Atom* copy = static_cast<LV2_Atom*>(malloc(size));
+ auto* copy = static_cast<LV2_Atom*>(malloc(size));
memcpy(copy, ev, size);
events.push_front(copy);
}
diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp
index 8421ed94..62fef4e3 100644
--- a/src/server/ingen_jack.cpp
+++ b/src/server/ingen_jack.cpp
@@ -37,9 +37,9 @@ struct IngenJackModule : public ingen::Module {
return;
}
- server::JackDriver* driver = new server::JackDriver(*engine);
- const Atom& s = world.conf().option("jack-server");
- const std::string server_name = s.is_valid() ? s.ptr<char>() : "";
+ auto* driver = new server::JackDriver(*engine);
+ const Atom& s = world.conf().option("jack-server");
+ const std::string server_name = s.is_valid() ? s.ptr<char>() : "";
driver->attach(server_name,
world.conf().option("jack-name").ptr<char>(),
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 7f6a430e..2bf44762 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -153,8 +153,7 @@ public:
static_cast<LV2_Atom*>(lv2_buf)));
if (graph_port->symbol() == "control") { // TODO: Safe to use index?
- LV2_Atom_Sequence* seq =
- reinterpret_cast<LV2_Atom_Sequence*>(lv2_buf);
+ auto* seq = reinterpret_cast<LV2_Atom_Sequence*>(lv2_buf);
bool enqueued = false;
LV2_ATOM_SEQUENCE_FOREACH(seq, ev)
@@ -267,9 +266,8 @@ public:
}
void append_time_events(RunContext& context, Buffer& buffer) override {
- const URIs& uris = _engine.world().uris();
- LV2_Atom_Sequence* seq =
- static_cast<LV2_Atom_Sequence*>(_ports[0]->buffer());
+ const URIs& uris = _engine.world().uris();
+ auto* seq = static_cast<LV2_Atom_Sequence*>(_ports[0]->buffer());
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
if (ev->body.type == uris.atom_Object) {
@@ -347,9 +345,7 @@ public:
return;
}
- LV2_Atom_Sequence* seq =
- static_cast<LV2_Atom_Sequence*>(_ports[1]->buffer());
-
+ auto* seq = static_cast<LV2_Atom_Sequence*>(_ports[1]->buffer());
if (!seq) {
_engine.log().rt_error("Notify output not connected\n");
return;
@@ -373,8 +369,9 @@ public:
break; // Output port buffer full, resume next time
}
- LV2_Atom_Event* ev = reinterpret_cast<LV2_Atom_Event*>(
- reinterpret_cast<uint8_t*>(seq) + lv2_atom_total_size(&seq->atom));
+ auto* ev = reinterpret_cast<LV2_Atom_Event*>(
+ reinterpret_cast<uint8_t*>(seq) +
+ lv2_atom_total_size(&seq->atom));
ev->time.frames = 0; // TODO: Time?
ev->body = atom;
@@ -547,7 +544,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
return nullptr;
}
- IngenPlugin* plugin = new IngenPlugin();
+ auto* plugin = new IngenPlugin();
plugin->map = map;
plugin->world = UPtr<ingen::World>(new ingen::World(map, unmap, log));
plugin->world->load_configuration(plugin->argc, plugin->argv);
@@ -593,7 +590,7 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
server::ThreadManager::set_flag(server::THREAD_PRE_PROCESS);
server::ThreadManager::single_threaded = true;
- LV2Driver* driver = new LV2Driver(*engine.get(), block_length, seq_size, rate);
+ auto* driver = new LV2Driver(*engine.get(), block_length, seq_size, rate);
engine->set_driver(SPtr<ingen::server::Driver>(driver));
engine->activate();
@@ -634,7 +631,7 @@ ingen_connect_port(LV2_Handle instance, uint32_t port, void* data)
{
using namespace ingen::server;
- IngenPlugin* me = static_cast<IngenPlugin*>(instance);
+ auto* me = static_cast<IngenPlugin*>(instance);
server::Engine* engine = static_cast<server::Engine*>(me->world->engine().get());
const SPtr<LV2Driver>& driver = static_ptr_cast<LV2Driver>(engine->driver());
if (port < driver->ports().size()) {
@@ -647,7 +644,7 @@ ingen_connect_port(LV2_Handle instance, uint32_t port, void* data)
static void
ingen_activate(LV2_Handle instance)
{
- IngenPlugin* me = static_cast<IngenPlugin*>(instance);
+ auto* me = static_cast<IngenPlugin*>(instance);
SPtr<server::Engine> engine = static_ptr_cast<server::Engine>(me->world->engine());
const SPtr<LV2Driver>& driver = static_ptr_cast<LV2Driver>(engine->driver());
engine->activate();
@@ -657,7 +654,7 @@ ingen_activate(LV2_Handle instance)
static void
ingen_run(LV2_Handle instance, uint32_t sample_count)
{
- IngenPlugin* me = static_cast<IngenPlugin*>(instance);
+ auto* me = static_cast<IngenPlugin*>(instance);
SPtr<server::Engine> engine = static_ptr_cast<server::Engine>(me->world->engine());
const SPtr<LV2Driver>& driver = static_ptr_cast<LV2Driver>(engine->driver());
@@ -670,7 +667,7 @@ ingen_run(LV2_Handle instance, uint32_t sample_count)
static void
ingen_deactivate(LV2_Handle instance)
{
- IngenPlugin* me = static_cast<IngenPlugin*>(instance);
+ auto* me = static_cast<IngenPlugin*>(instance);
me->world->engine()->deactivate();
if (me->main) {
me->main->join();
@@ -681,7 +678,7 @@ ingen_deactivate(LV2_Handle instance)
static void
ingen_cleanup(LV2_Handle instance)
{
- IngenPlugin* me = static_cast<IngenPlugin*>(instance);
+ auto* me = static_cast<IngenPlugin*>(instance);
me->world->set_engine(SPtr<ingen::server::Engine>());
me->world->set_interface(SPtr<ingen::Interface>());
if (me->main) {
@@ -714,7 +711,7 @@ ingen_save(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- IngenPlugin* plugin = static_cast<IngenPlugin*>(instance);
+ auto* plugin = static_cast<IngenPlugin*>(instance);
LV2_State_Map_Path* map_path = nullptr;
LV2_State_Make_Path* make_path = nullptr;
@@ -761,7 +758,7 @@ ingen_restore(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
- IngenPlugin* plugin = static_cast<IngenPlugin*>(instance);
+ auto* plugin = static_cast<IngenPlugin*>(instance);
LV2_State_Map_Path* map_path = nullptr;
get_state_features(features, &map_path, nullptr);
@@ -876,7 +873,7 @@ lv2_lib_descriptor(const char* bundle_path,
Lib* lib = new Lib(bundle_path);
// FIXME: memory leak. I think the LV2_Lib_Descriptor API is botched :(
- LV2_Lib_Descriptor* desc = static_cast<LV2_Lib_Descriptor*>(malloc(desc_size));
+ auto* desc = static_cast<LV2_Lib_Descriptor*>(malloc(desc_size));
desc->handle = lib;
desc->size = desc_size;
desc->cleanup = lib_cleanup;
diff --git a/src/server/ingen_portaudio.cpp b/src/server/ingen_portaudio.cpp
index 09229f91..81f6e65c 100644
--- a/src/server/ingen_portaudio.cpp
+++ b/src/server/ingen_portaudio.cpp
@@ -36,7 +36,7 @@ struct IngenPortAudioModule : public ingen::Module {
return;
}
- server::PortAudioDriver* driver = new server::PortAudioDriver(*engine);
+ auto* driver = new server::PortAudioDriver(*engine);
driver->attach();
engine->set_driver(SPtr<server::Driver>(driver));
}
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index a4f7ef43..4c253cc1 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -110,11 +110,12 @@ ControllerNode::ControllerNode(InternalPlugin* plugin,
void
ControllerNode::run(RunContext& context)
{
- const BufferRef midi_in = _midi_in_port->buffer(0);
- LV2_Atom_Sequence* seq = midi_in->get<LV2_Atom_Sequence>();
- const BufferRef midi_out = _midi_out_port->buffer(0);
+ const BufferRef midi_in = _midi_in_port->buffer(0);
+ auto* seq = midi_in->get<LV2_Atom_Sequence>();
+ const BufferRef midi_out = _midi_out_port->buffer(0);
+
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
- const uint8_t* buf = static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
+ const auto* buf = static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
if (ev->body.type == _midi_in_port->bufs().uris().midi_MidiEvent &&
ev->body.size >= 3 &&
lv2_midi_message_type(buf) == LV2_MIDI_MSG_CONTROLLER) {
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp
index 0d375eac..b2a22c14 100644
--- a/src/server/internals/Note.cpp
+++ b/src/server/internals/Note.cpp
@@ -164,10 +164,11 @@ NoteNode::apply_poly(RunContext& context, uint32_t poly)
void
NoteNode::run(RunContext& context)
{
- Buffer* const midi_in = _midi_in_port->buffer(0).get();
- LV2_Atom_Sequence* seq = midi_in->get<LV2_Atom_Sequence>();
+ Buffer* const midi_in = _midi_in_port->buffer(0).get();
+ auto* seq = midi_in->get<LV2_Atom_Sequence>();
+
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
- const uint8_t* buf =
+ const auto* buf =
static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
const FrameTime time =
diff --git a/src/server/internals/Time.cpp b/src/server/internals/Time.cpp
index 3b6f12ba..a771b9a9 100644
--- a/src/server/internals/Time.cpp
+++ b/src/server/internals/Time.cpp
@@ -61,8 +61,8 @@ TimeNode::TimeNode(InternalPlugin* plugin,
void
TimeNode::run(RunContext& context)
{
- BufferRef buf = _notify_port->buffer(0);
- LV2_Atom_Sequence* seq = buf->get<LV2_Atom_Sequence>();
+ BufferRef buf = _notify_port->buffer(0);
+ auto* seq = buf->get<LV2_Atom_Sequence>();
// Initialise output to the empty sequence
seq->atom.type = _notify_port->bufs().uris().atom_Sequence;
diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp
index f9c21438..0fe5715c 100644
--- a/src/server/internals/Trigger.cpp
+++ b/src/server/internals/Trigger.cpp
@@ -106,17 +106,18 @@ TriggerNode::TriggerNode(InternalPlugin* plugin,
void
TriggerNode::run(RunContext& context)
{
- const BufferRef midi_in = _midi_in_port->buffer(0);
- LV2_Atom_Sequence* const seq = midi_in->get<LV2_Atom_Sequence>();
- const BufferRef midi_out = _midi_out_port->buffer(0);
+ const BufferRef midi_in = _midi_in_port->buffer(0);
+ auto* const seq = midi_in->get<LV2_Atom_Sequence>();
+ const BufferRef midi_out = _midi_out_port->buffer(0);
// Initialise output to the empty sequence
midi_out->prepare_write(context);
LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
- const int64_t t = ev->time.frames;
- const uint8_t* buf = static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
- bool emit = false;
+ const int64_t t = ev->time.frames;
+ const auto* buf =
+ static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
+ bool emit = false;
if (ev->body.type == _midi_in_port->bufs().uris().midi_MidiEvent &&
ev->body.size >= 3) {
const FrameTime time = context.start() + t;
diff --git a/src/server/mix.cpp b/src/server/mix.cpp
index e6f999f4..75d31931 100644
--- a/src/server/mix.cpp
+++ b/src/server/mix.cpp
@@ -27,7 +27,7 @@ namespace server {
static inline bool
is_end(const Buffer* buf, const LV2_Atom_Event* ev)
{
- const LV2_Atom* atom = buf->get<const LV2_Atom>();
+ const auto* atom = buf->get<const LV2_Atom>();
return lv2_atom_sequence_is_end(
static_cast<const LV2_Atom_Sequence_Body*>(LV2_ATOM_BODY_CONST(atom)),
atom->size,
@@ -74,7 +74,7 @@ mix(const RunContext& context,
for (uint32_t i = 0; i < num_srcs; ++i) {
iters[i] = nullptr;
if (srcs[i]->is_sequence()) {
- const LV2_Atom_Sequence* seq = srcs[i]->get<const LV2_Atom_Sequence>();
+ const auto* seq = srcs[i]->get<const LV2_Atom_Sequence>();
iters[i] = lv2_atom_sequence_begin(&seq->body);
if (is_end(srcs[i], iters[i])) {
iters[i] = nullptr;