diff options
author | David Robillard <d@drobilla.net> | 2010-02-23 20:25:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-23 20:25:53 +0000 |
commit | 650c6d5824222a8879df5c5ba9645c264ed3b84f (patch) | |
tree | 7cd5aace00cb23622f07727ae4f7963c03dd05c9 /libs/ardour/location.cc | |
parent | 0c20d48e7d436725396baf362368f7ce61717151 (diff) |
Fix various code quality issues found by cppcheck (e.g. uninitialized members, larger than necessary variable scope, memory leaks, etc).
git-svn-id: svn://localhost/ardour2/branches/3.0@6710 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/location.cc')
-rw-r--r-- | libs/ardour/location.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 7e3330ecd9..4861718d85 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -676,15 +676,12 @@ Locations::get_state () int Locations::set_state (const XMLNode& node, int /*version*/) { - XMLNodeList nlist; - XMLNodeConstIterator niter; - if (node.name() != "Locations") { error << _("incorrect XML mode passed to Locations::set_state") << endmsg; return -1; } - nlist = node.children(); + XMLNodeList nlist = node.children(); locations.clear (); current_location = 0; @@ -692,6 +689,7 @@ Locations::set_state (const XMLNode& node, int /*version*/) { Glib::Mutex::Lock lm (lock); + XMLNodeConstIterator niter; for (niter = nlist.begin(); niter != nlist.end(); ++niter) { try { @@ -910,7 +908,7 @@ Location * Locations::get_location_by_id(PBD::ID id) { LocationList::iterator it; - for (it = locations.begin(); it != locations.end(); it++) + for (it = locations.begin(); it != locations.end(); ++it) if (id == (*it)->id()) return *it; |