diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/.clang-tidy | 1 | ||||
-rw-r--r-- | src/server/BlockFactory.cpp | 2 | ||||
-rw-r--r-- | src/server/ControlBindings.cpp | 2 | ||||
-rw-r--r-- | src/server/LV2Block.cpp | 2 | ||||
-rw-r--r-- | src/server/events/Copy.cpp | 6 | ||||
-rw-r--r-- | src/server/events/CreateBlock.cpp | 14 | ||||
-rw-r--r-- | src/server/events/CreateGraph.cpp | 10 | ||||
-rw-r--r-- | src/server/events/CreatePort.cpp | 19 | ||||
-rw-r--r-- | src/server/events/Delete.cpp | 2 | ||||
-rw-r--r-- | src/server/events/Delta.cpp | 2 | ||||
-rw-r--r-- | src/server/events/DisconnectAll.cpp | 2 | ||||
-rw-r--r-- | src/server/events/Move.cpp | 2 |
12 files changed, 27 insertions, 37 deletions
diff --git a/src/server/.clang-tidy b/src/server/.clang-tidy index b5c1b4a1..deab7090 100644 --- a/src/server/.clang-tidy +++ b/src/server/.clang-tidy @@ -8,7 +8,6 @@ Checks: > -*-non-private-member-variables-in-classes, -*-special-member-functions, -*-uppercase-literal-suffix, - -*-use-auto, -*-vararg, -abseil-string-find-str-contains, -altera-*, diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp index d36924ae..2186b779 100644 --- a/src/server/BlockFactory.cpp +++ b/src/server/BlockFactory.cpp @@ -98,7 +98,7 @@ PluginImpl* BlockFactory::plugin(const URI& uri) { load_plugin(uri); - const Plugins::const_iterator i = _plugins.find(uri); + const auto i = _plugins.find(uri); return ((i != _plugins.end()) ? i->second.get() : nullptr); } diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 8bf52dfd..8ae4f7c2 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -426,7 +426,7 @@ ControlBindings::pre_process(RunContext& ctx, Buffer* buffer) // Set all controls bound to this key const Binding k = {key, nullptr}; - for (Bindings::const_iterator i = _bindings->lower_bound(k); + for (auto i = _bindings->lower_bound(k); i != _bindings->end() && i->key == key; ++i) { set_port_value(ctx, i->port, key.type, value); diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index 026b7d06..eb2ed346 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -729,7 +729,7 @@ LV2Block::save_preset(const URI& uri, nullptr)}; if (state) { - const Properties::const_iterator l = props.find(_uris.rdfs_label); + const auto l = props.find(_uris.rdfs_label); if (l != props.end() && l->second.type() == _uris.atom_String) { lilv_state_set_label(state.get(), l->second.ptr<char>()); } diff --git a/src/server/events/Copy.cpp b/src/server/events/Copy.cpp index 9ce7ead6..ebfea41d 100644 --- a/src/server/events/Copy.cpp +++ b/src/server/events/Copy.cpp @@ -69,7 +69,7 @@ Copy::pre_process(PreProcessContext& ctx) const raul::Path old_path = uri_to_path(_msg.old_uri); // Find the old node - const Store::iterator i = _engine.store()->find(old_path); + const auto i = _engine.store()->find(old_path); if (i == _engine.store()->end()) { return Event::pre_process_done(Status::NOT_FOUND, old_path); } @@ -115,8 +115,8 @@ Copy::engine_to_engine(PreProcessContext& ctx) } // Find new parent graph - const raul::Path parent_path = new_path.parent(); - const Store::iterator p = _engine.store()->find(parent_path); + const raul::Path parent_path = new_path.parent(); + const auto p = _engine.store()->find(parent_path); if (p == _engine.store()->end()) { return Event::pre_process_done(Status::NOT_FOUND, parent_path); } diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index 0898a6a0..742eabfe 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -73,8 +73,6 @@ CreateBlock::~CreateBlock() = default; bool CreateBlock::pre_process(PreProcessContext& ctx) { - using iterator = Properties::const_iterator; - const ingen::URIs& uris = _engine.world().uris(); const std::shared_ptr<Store> store = _engine.store(); @@ -88,7 +86,7 @@ CreateBlock::pre_process(PreProcessContext& ctx) } // Map old ingen:prototype to new lv2:prototype - auto range = _properties.equal_range(uris.ingen_prototype); + const auto range = _properties.equal_range(uris.ingen_prototype); for (auto i = range.first; i != range.second;) { const auto value = i->second; auto next = i; @@ -98,7 +96,7 @@ CreateBlock::pre_process(PreProcessContext& ctx) } // Get prototype - iterator t = _properties.find(uris.lv2_prototype); + const auto t = _properties.find(uris.lv2_prototype); if (t == _properties.end() || !uris.forge.is_uri(t->second)) { // Missing/invalid prototype return Event::pre_process_done(Status::BAD_REQUEST); @@ -107,10 +105,10 @@ CreateBlock::pre_process(PreProcessContext& ctx) const URI prototype(uris.forge.str(t->second, false)); // Find polyphony - const iterator p = _properties.find(uris.ingen_polyphonic); - const bool polyphonic = (p != _properties.end() && - p->second.type() == uris.forge.Bool && - p->second.get<int32_t>()); + const auto p = _properties.find(uris.ingen_polyphonic); + const bool polyphonic = (p != _properties.end() && + p->second.type() == uris.forge.Bool && + p->second.get<int32_t>()); // Find and instantiate/duplicate prototype (plugin/existing node) if (uri_is_path(prototype)) { diff --git a/src/server/events/CreateGraph.cpp b/src/server/events/CreateGraph.cpp index 2a74ddf0..895a84e7 100644 --- a/src/server/events/CreateGraph.cpp +++ b/src/server/events/CreateGraph.cpp @@ -136,11 +136,9 @@ CreateGraph::pre_process(PreProcessContext& ctx) const ingen::URIs& uris = _engine.world().uris(); - using iterator = Properties::const_iterator; - - uint32_t ext_poly = 1; - uint32_t int_poly = 1; - iterator p = _properties.find(uris.ingen_polyphony); + uint32_t ext_poly = 1; + uint32_t int_poly = 1; + const auto p = _properties.find(uris.ingen_polyphony); if (p != _properties.end() && p->second.type() == uris.forge.Int) { int_poly = p->second.get<int32_t>(); } @@ -156,7 +154,7 @@ CreateGraph::pre_process(PreProcessContext& ctx) const raul::Symbol symbol(_path.is_root() ? "graph" : _path.symbol()); // Get graph prototype - iterator t = _properties.find(uris.lv2_prototype); + auto t = _properties.find(uris.lv2_prototype); if (t == _properties.end()) { t = _properties.find(uris.lv2_prototype); } diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 1fa2a528..ba2c9a9a 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -66,11 +66,8 @@ CreatePort::CreatePort(Engine& engine, { const ingen::URIs& uris = _engine.world().uris(); - using Iterator = Properties::const_iterator; - using Range = std::pair<Iterator, Iterator>; - - const Range types = properties.equal_range(uris.rdf_type); - for (Iterator i = types.first; i != types.second; ++i) { + const auto types = properties.equal_range(uris.rdf_type); + for (auto i = types.first; i != types.second; ++i) { const Atom& type = i->second; if (type == uris.lv2_AudioPort) { _port_type = PortType::AUDIO; @@ -87,8 +84,8 @@ CreatePort::CreatePort(Engine& engine, } } - const Range buffer_types = properties.equal_range(uris.atom_bufferType); - for (Iterator i = buffer_types.first; i != buffer_types.second; ++i) { + const auto buffer_types = properties.equal_range(uris.atom_bufferType); + for (auto i = buffer_types.first; i != buffer_types.second; ++i) { if (uris.forge.is_uri(i->second)) { _buf_type = _engine.world().uri_map().map_uri( uris.forge.str(i->second, false)); @@ -123,10 +120,8 @@ CreatePort::pre_process(PreProcessContext&) const uint32_t buf_size = bufs.default_size(_buf_type); const int32_t old_n_ports = _graph->num_ports_non_rt(); - using PropIter = Properties::const_iterator; - - PropIter index_i = _properties.find(uris.lv2_index); - int32_t index = 0; + auto index_i = _properties.find(uris.lv2_index); + int32_t index = 0; if (index_i != _properties.end()) { // Ensure given index is sane and not taken if (index_i->second.type() != uris.forge.Int) { @@ -144,7 +139,7 @@ CreatePort::pre_process(PreProcessContext&) _engine.world().forge().make(index)); } - const PropIter poly_i = _properties.find(uris.ingen_polyphonic); + const auto poly_i = _properties.find(uris.ingen_polyphonic); const bool polyphonic = (poly_i != _properties.end() && poly_i->second.type() == uris.forge.Bool && poly_i->second.get<int32_t>()); diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index 3347b549..bdd25f1b 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -72,7 +72,7 @@ Delete::Delete(Engine& engine, Delete::~Delete() { - for (ControlBindings::Binding* b : _removed_bindings) { + for (auto* b : _removed_bindings) { delete b; } } diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 17f3c716..09d9c3b2 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -515,7 +515,7 @@ Delta::execute(RunContext& ctx) auto* const block = dynamic_cast<BlockImpl*>(_object); auto* const port = dynamic_cast<PortImpl*>(_object); - std::vector<SpecialType>::const_iterator t = _types.begin(); + auto t = _types.begin(); for (const auto& p : _properties) { const URI& key = p.first; const Atom& value = p.second; diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 220418e4..729b102c 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -123,7 +123,7 @@ DisconnectAll::pre_process(PreProcessContext& ctx) // Create disconnect events to erase adjacent arcs in parent's parent if (_port && _parent->parent()) { - GraphImpl* parent_parent = dynamic_cast<GraphImpl*>(_parent->parent()); + auto* const parent_parent = dynamic_cast<GraphImpl*>(_parent->parent()); for (const auto& a : adjacent_arcs(parent_parent)) { _impls.push_back( new Disconnect::Impl(_engine, diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index d85451c8..ddee82b7 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -53,7 +53,7 @@ Move::pre_process(PreProcessContext&) return Event::pre_process_done(Status::PARENT_DIFFERS, _msg.new_path); } - const Store::iterator i = _engine.store()->find(_msg.old_path); + const auto i = _engine.store()->find(_msg.old_path); if (i == _engine.store()->end()) { return Event::pre_process_done(Status::NOT_FOUND, _msg.old_path); } |