From 0404876d7b9698f93de1950f0b5111d6b0667712 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 1 Dec 2020 12:03:38 +0100 Subject: [PATCH] Fix reliance on deprecated implicit assignment operators Either both, or neither, a copy constructor and assignment operator should be defined. This fixes Wdeprecated-copy warnings. --- libs/ardour/ardour/types.h | 6 ++++-- libs/ardour/region.cc | 2 +- libs/pbd/pbd/properties.h | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index f5c083d345..b28f181f94 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -746,17 +746,19 @@ enum MidiPortFlags { struct LatencyRange { LatencyRange () : min (0), max (0) {} + LatencyRange (const LatencyRange& other) : min (other.min), max (other.max) {} uint32_t min; //< samples uint32_t max; //< samples - bool operator==(const LatencyRange& other) { + bool operator==(const LatencyRange& other) const { return (min == other.min && max == other.max); } - void operator=(const LatencyRange& other) { + LatencyRange& operator=(const LatencyRange& other) { min = other.min; max = other.max; + return *this; } }; diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index ab6042af30..616b1221bc 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -311,7 +311,7 @@ Region::Region (boost::shared_ptr other) use_sources (other->_sources); set_master_sources (other->_master_sources); - _position_lock_style = other->_position_lock_style; + _position_lock_style = other->_position_lock_style.val(); _first_edit = other->_first_edit; _start = other->_start; diff --git a/libs/pbd/pbd/properties.h b/libs/pbd/pbd/properties.h index 5e3412ebf0..02b3320624 100644 --- a/libs/pbd/pbd/properties.h +++ b/libs/pbd/pbd/properties.h @@ -343,6 +343,7 @@ private: /* no copy-construction */ EnumProperty (EnumProperty const &); + EnumProperty& operator= (EnumProperty const &); }; /** A Property which holds a shared_ptr to a Stateful object,