summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-25 16:37:00 -0500
committerDavid Robillard <d@drobilla.net>2017-12-25 16:37:00 -0500
commit37729e5b314e39fb750a3fb46a005acdb15b4ac2 (patch)
tree5e8e316e9f186dc47bfef09c7546cc3a8f14f6bb /src/server
parent05bce078b6b5cfc64f10399da3a422d00fe6f790 (diff)
downloadingen-37729e5b314e39fb750a3fb46a005acdb15b4ac2.tar.gz
ingen-37729e5b314e39fb750a3fb46a005acdb15b4ac2.tar.bz2
ingen-37729e5b314e39fb750a3fb46a005acdb15b4ac2.zip
Use auto for iterators
Diffstat (limited to 'src/server')
-rw-r--r--src/server/BlockFactory.cpp4
-rw-r--r--src/server/DuplexPort.cpp3
-rw-r--r--src/server/GraphImpl.cpp8
-rw-r--r--src/server/NodeImpl.cpp2
-rw-r--r--src/server/events/CreateBlock.cpp2
-rw-r--r--src/server/events/Delete.cpp2
-rw-r--r--src/server/events/Disconnect.cpp4
-rw-r--r--src/server/ingen_lv2.cpp2
8 files changed, 13 insertions, 14 deletions
diff --git a/src/server/BlockFactory.cpp b/src/server/BlockFactory.cpp
index 1cae6f58..d33be9fc 100644
--- a/src/server/BlockFactory.cpp
+++ b/src/server/BlockFactory.cpp
@@ -82,7 +82,7 @@ BlockFactory::refresh()
// Add any new plugins to response
std::set<PluginImpl*> new_plugins;
for (const auto& p : _plugins) {
- Plugins::const_iterator o = old_plugins.find(p.first);
+ auto o = old_plugins.find(p.first);
if (o == old_plugins.end()) {
new_plugins.insert(p.second);
}
@@ -213,7 +213,7 @@ BlockFactory::load_lv2_plugins()
continue;
}
- Plugins::iterator p = _plugins.find(uri);
+ auto p = _plugins.find(uri);
if (p == _plugins.end()) {
LV2Plugin* const plugin = new LV2Plugin(_world, lv2_plug);
_plugins.insert(make_pair(uri, plugin));
diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp
index a9076239..e81114ff 100644
--- a/src/server/DuplexPort.cpp
+++ b/src/server/DuplexPort.cpp
@@ -111,8 +111,7 @@ DuplexPort::inherit_neighbour(const PortImpl* port,
add.insert(std::make_pair(uris.lv2_maximum, port->maximum()));
}
} else if (_type == PortType::ATOM) {
- for (Properties::const_iterator i = port->properties().find(
- uris.atom_supports);
+ for (auto i = port->properties().find(uris.atom_supports);
i != port->properties().end() && i->first == uris.atom_supports;
++i) {
set_property(i->first, i->second);
diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp
index ec73a8c8..f9c4cb54 100644
--- a/src/server/GraphImpl.cpp
+++ b/src/server/GraphImpl.cpp
@@ -110,8 +110,8 @@ GraphImpl::duplicate(Engine& engine,
for (const auto& a : _arcs) {
SPtr<ArcImpl> arc = dynamic_ptr_cast<ArcImpl>(a.second);
if (arc) {
- PortMap::iterator t = port_map.find(arc->tail());
- PortMap::iterator h = port_map.find(arc->head());
+ auto t = port_map.find(arc->tail());
+ auto h = port_map.find(arc->head());
if (t != port_map.end() && h != port_map.end()) {
dup->add_arc(SPtr<ArcImpl>(new ArcImpl(t->second, h->second)));
}
@@ -277,7 +277,7 @@ SPtr<ArcImpl>
GraphImpl::remove_arc(const PortImpl* tail, const PortImpl* dst_port)
{
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- Arcs::iterator i = _arcs.find(std::make_pair(tail, dst_port));
+ auto i = _arcs.find(std::make_pair(tail, dst_port));
if (i != _arcs.end()) {
SPtr<ArcImpl> arc = dynamic_ptr_cast<ArcImpl>(i->second);
_arcs.erase(i);
@@ -291,7 +291,7 @@ bool
GraphImpl::has_arc(const PortImpl* tail, const PortImpl* dst_port) const
{
ThreadManager::assert_thread(THREAD_PRE_PROCESS);
- Arcs::const_iterator i = _arcs.find(std::make_pair(tail, dst_port));
+ auto i = _arcs.find(std::make_pair(tail, dst_port));
return (i != _arcs.end());
}
diff --git a/src/server/NodeImpl.cpp b/src/server/NodeImpl.cpp
index 852dfd63..d26fa51f 100644
--- a/src/server/NodeImpl.cpp
+++ b/src/server/NodeImpl.cpp
@@ -36,7 +36,7 @@ NodeImpl::get_property(const Raul::URI& key) const
{
ThreadManager::assert_not_thread(THREAD_PROCESS);
static const Atom null_atom;
- Properties::const_iterator i = properties().find(key);
+ auto i = properties().find(key);
return (i != properties().end()) ? i->second : null_atom;
}
diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp
index d2a7d350..1a70223c 100644
--- a/src/server/events/CreateBlock.cpp
+++ b/src/server/events/CreateBlock.cpp
@@ -117,7 +117,7 @@ CreateBlock::pre_process(PreProcessContext& ctx)
// Load state from directory if given in properties
LilvState* state = nullptr;
- Properties::iterator s = _properties.find(uris.state_state);
+ auto s = _properties.find(uris.state_state);
if (s != _properties.end() && s->second.type() == uris.forge.Path) {
state = LV2Block::load_state(_engine.world(), s->second.ptr<char>());
}
diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp
index e50e5fa8..310579aa 100644
--- a/src/server/events/Delete.cpp
+++ b/src/server/events/Delete.cpp
@@ -67,7 +67,7 @@ Delete::pre_process(PreProcessContext& ctx)
_engine.control_bindings()->get_all(_path, _removed_bindings);
- Store::iterator iter = _engine.store()->find(_path);
+ auto iter = _engine.store()->find(_path);
if (iter == _engine.store()->end()) {
return Event::pre_process_done(Status::NOT_FOUND, _path);
}
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 7e38ffe1..4553c8a2 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -68,13 +68,13 @@ Disconnect::Impl::Impl(Engine& e,
BlockImpl* const head_block = _head->parent_block();
// Remove tail from head's providers
- std::set<BlockImpl*>::iterator hp = head_block->providers().find(tail_block);
+ auto hp = head_block->providers().find(tail_block);
if (hp != head_block->providers().end()) {
head_block->providers().erase(hp);
}
// Remove head from tail's providers
- std::set<BlockImpl*>::iterator td = tail_block->dependants().find(head_block);
+ auto td = tail_block->dependants().find(head_block);
if (td != tail_block->dependants().end()) {
tail_block->dependants().erase(td);
}
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 92cb52b0..8dfea405 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -700,7 +700,7 @@ ingen_save(LV2_Handle instance,
char* real_path = make_path->path(make_path->handle, "main.ttl");
char* state_path = map_path->abstract_path(map_path->handle, real_path);
- Ingen::Store::iterator root = plugin->world->store()->find(Raul::Path("/"));
+ auto root = plugin->world->store()->find(Raul::Path("/"));
{
std::lock_guard<std::mutex> lock(plugin->world->rdf_mutex());