Make static analysis happy..

If the copy c'tor of ProcessorSelection was actually used,
assigning the XMLProcessorSelection
    processors = other.processors;
would lead to duplicate free() of the XMLNode*
XMLProcessorSelection would need a dedicated copy c'tor that
duplicates allocates a new XMLNode.
see also #10 at https://www.viva64.com/en/b/0540/

Anyway, the copy c'tor and assignment is never used. This commit makes
this explicit.
This commit is contained in:
Robin Gareus 2017-11-23 11:29:07 +01:00
parent c591368133
commit a07bd2d585
4 changed files with 7 additions and 23 deletions

View file

@ -18,16 +18,6 @@
#include "processor_selection.h"
ProcessorSelection&
ProcessorSelection::operator= (ProcessorSelection const & other)
{
if (this != &other) {
processors = other.processors;
}
return *this;
}
void
ProcessorSelection::clear_processors ()
{

View file

@ -67,7 +67,6 @@ class ProcessorSelection : public PBD::ScopedConnectionList, public sigc::tracka
XMLProcessorSelection processors;
sigc::signal<void> ProcessorsChanged;
ProcessorSelection& operator= (const ProcessorSelection& other);
void clear ();
bool empty();
@ -76,6 +75,10 @@ class ProcessorSelection : public PBD::ScopedConnectionList, public sigc::tracka
void add (XMLNode* node);
void clear_processors ();
private:
ProcessorSelection& operator= (const ProcessorSelection& other);
ProcessorSelection (ProcessorSelection const&);
};
bool operator==(const ProcessorSelection& a, const ProcessorSelection& b);

View file

@ -43,16 +43,6 @@ RouteProcessorSelection::RouteProcessorSelection (SessionHandlePtr& s, AxisViewP
{
}
RouteProcessorSelection&
RouteProcessorSelection::operator= (const RouteProcessorSelection& other)
{
if (&other != this) {
(*((ProcessorSelection*) this)) = (*((ProcessorSelection const *) &other));
axes = other.axes;
}
return *this;
}
bool
operator== (const RouteProcessorSelection& a, const RouteProcessorSelection& b)
{

View file

@ -39,8 +39,6 @@ public:
RouteProcessorSelection (ARDOUR::SessionHandlePtr&, AxisViewProvider&);
RouteProcessorSelection& operator= (const RouteProcessorSelection& other);
void clear ();
bool empty();
@ -58,6 +56,9 @@ private:
AxisViewProvider& avp;
void removed (AxisView*);
std::list<AxisView*> add_grouped_tracks (AxisView*) const;
RouteProcessorSelection& operator= (const RouteProcessorSelection& other);
RouteProcessorSelection (RouteProcessorSelection const&);
};
bool operator==(const RouteProcessorSelection& a, const RouteProcessorSelection& b);