From fa59391f6a8b8bffbf07fc567d726c40424fe7f7 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Sun, 4 Aug 2013 15:06:10 +0100 Subject: 'libs/ardour' - Use 'const_iterator' where appropriate (required to be buildable with MSVC) --- libs/ardour/diskstream.cc | 2 +- libs/ardour/playlist.cc | 8 ++++---- libs/ardour/route.cc | 2 +- libs/ardour/session_playlists.cc | 8 ++++---- libs/pbd/pbd/sequence_property.h | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 6ef4327343..d931cfd432 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -570,7 +570,7 @@ Diskstream::move_processor_automation (boost::weak_ptr p, list< Evora set const a = processor->what_can_be_automated (); - for (set::iterator i = a.begin (); i != a.end (); ++i) { + for (set::const_iterator i = a.begin (); i != a.end (); ++i) { boost::shared_ptr al = processor->automation_control(*i)->alist(); XMLNode & before = al->get_state (); bool const things_moved = al->move_ranges (movements); diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index bb79801c9f..47462a3575 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -1997,11 +1997,11 @@ Playlist::find_next_region (framepos_t frame, RegionPoint point, int dir) freeze (); /* add the added regions */ - for (RegionListProperty::ChangeContainer::iterator i = change.added.begin(); i != change.added.end(); ++i) { + for (RegionListProperty::ChangeContainer::const_iterator i = change.added.begin(); i != change.added.end(); ++i) { add_region_internal ((*i), (*i)->position()); } /* remove the removed regions */ - for (RegionListProperty::ChangeContainer::iterator i = change.removed.begin(); i != change.removed.end(); ++i) { + for (RegionListProperty::ChangeContainer::const_iterator i = change.removed.begin(); i != change.removed.end(); ++i) { remove_region (*i); } @@ -2488,7 +2488,7 @@ Playlist::uses_source (boost::shared_ptr src) const { RegionReadLock rlock (const_cast (this)); - for (set >::iterator r = all_regions.begin(); r != all_regions.end(); ++r) { + for (set >::const_iterator r = all_regions.begin(); r != all_regions.end(); ++r) { if ((*r)->uses_source (src)) { return true; } @@ -2533,7 +2533,7 @@ Playlist::region_by_id (const ID& id) const { /* searches all regions ever added to this playlist */ - for (set >::iterator i = all_regions.begin(); i != all_regions.end(); ++i) { + for (set >::const_iterator i = all_regions.begin(); i != all_regions.end(); ++i) { if ((*i)->id() == id) { return *i; } diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index f53acebe14..0fbd334879 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -2833,7 +2833,7 @@ Route::feeds (boost::shared_ptr other, bool* via_sends_only) { const FedBy& fed_by (other->fed_by()); - for (FedBy::iterator f = fed_by.begin(); f != fed_by.end(); ++f) { + for (FedBy::const_iterator f = fed_by.begin(); f != fed_by.end(); ++f) { boost::shared_ptr sr = f->r.lock(); if (sr && (sr.get() == this)) { diff --git a/libs/ardour/session_playlists.cc b/libs/ardour/session_playlists.cc index b2c4640880..b586ab196e 100644 --- a/libs/ardour/session_playlists.cc +++ b/libs/ardour/session_playlists.cc @@ -221,11 +221,11 @@ SessionPlaylists::get (vector >& s) const { Glib::Threads::Mutex::Lock lm (lock); - for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { + for (List::const_iterator i = playlists.begin(); i != playlists.end(); ++i) { s.push_back (*i); } - for (List::iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) { + for (List::const_iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) { s.push_back (*i); } } @@ -448,11 +448,11 @@ SessionPlaylists::region_use_count (boost::shared_ptr region) const Glib::Threads::Mutex::Lock lm (lock); uint32_t cnt = 0; - for (List::iterator i = playlists.begin(); i != playlists.end(); ++i) { + for (List::const_iterator i = playlists.begin(); i != playlists.end(); ++i) { cnt += (*i)->region_use_count (region); } - for (List::iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) { + for (List::const_iterator i = unused_playlists.begin(); i != unused_playlists.end(); ++i) { cnt += (*i)->region_use_count (region); } diff --git a/libs/pbd/pbd/sequence_property.h b/libs/pbd/pbd/sequence_property.h index b9d59724dd..63263819ca 100644 --- a/libs/pbd/pbd/sequence_property.h +++ b/libs/pbd/pbd/sequence_property.h @@ -94,14 +94,14 @@ class SequenceProperty : public PropertyBase /* record the change described in our change member */ if (!_changes.added.empty()) { - for (typename ChangeContainer::iterator i = _changes.added.begin(); i != _changes.added.end(); ++i) { + for (typename ChangeContainer::const_iterator i = _changes.added.begin(); i != _changes.added.end(); ++i) { XMLNode* add_node = new XMLNode ("Add"); child->add_child_nocopy (*add_node); get_content_as_xml (*i, *add_node); } } if (!_changes.removed.empty()) { - for (typename ChangeContainer::iterator i = _changes.removed.begin(); i != _changes.removed.end(); ++i) { + for (typename ChangeContainer::const_iterator i = _changes.removed.begin(); i != _changes.removed.end(); ++i) { XMLNode* remove_node = new XMLNode ("Remove"); child->add_child_nocopy (*remove_node); get_content_as_xml (*i, *remove_node); @@ -170,7 +170,7 @@ class SequenceProperty : public PropertyBase with this diff(). */ - for (typename ChangeContainer::iterator i = a->changes().added.begin(); i != a->changes().added.end(); ++i) { + for (typename ChangeContainer::const_iterator i = a->changes().added.begin(); i != a->changes().added.end(); ++i) { (*i)->DropReferences.connect_same_thread (*cmd, boost::bind (&Destructible::drop_references, cmd)); } } -- cgit v1.2.3