From a07bd2d5853aa7d383e325f0f5c1d88218e303c7 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 23 Nov 2017 11:29:07 +0100 Subject: 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. --- gtk2_ardour/processor_selection.cc | 10 ---------- gtk2_ardour/processor_selection.h | 5 ++++- gtk2_ardour/route_processor_selection.cc | 10 ---------- gtk2_ardour/route_processor_selection.h | 5 +++-- 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/gtk2_ardour/processor_selection.cc b/gtk2_ardour/processor_selection.cc index a9833096d2..47a9fe22ec 100644 --- a/gtk2_ardour/processor_selection.cc +++ b/gtk2_ardour/processor_selection.cc @@ -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 () { diff --git a/gtk2_ardour/processor_selection.h b/gtk2_ardour/processor_selection.h index fc3a133ef1..7de1c4735e 100644 --- a/gtk2_ardour/processor_selection.h +++ b/gtk2_ardour/processor_selection.h @@ -67,7 +67,6 @@ class ProcessorSelection : public PBD::ScopedConnectionList, public sigc::tracka XMLProcessorSelection processors; sigc::signal 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); diff --git a/gtk2_ardour/route_processor_selection.cc b/gtk2_ardour/route_processor_selection.cc index ed182db415..ac334b4b87 100644 --- a/gtk2_ardour/route_processor_selection.cc +++ b/gtk2_ardour/route_processor_selection.cc @@ -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) { diff --git a/gtk2_ardour/route_processor_selection.h b/gtk2_ardour/route_processor_selection.h index d92436dbc4..80ab9e6adf 100644 --- a/gtk2_ardour/route_processor_selection.h +++ b/gtk2_ardour/route_processor_selection.h @@ -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 add_grouped_tracks (AxisView*) const; + + RouteProcessorSelection& operator= (const RouteProcessorSelection& other); + RouteProcessorSelection (RouteProcessorSelection const&); }; bool operator==(const RouteProcessorSelection& a, const RouteProcessorSelection& b); -- cgit v1.2.3