From 5d3a418a26a06a1084ea387b0176c56598bcd23a Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Tue, 3 Dec 2019 11:13:26 +0100 Subject: [PATCH] Add explicit copy constructors and assign operators for some classes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It should fix compilation errors that happen on some iOS bots saying "definition of implicit copy assignment operator for 'Foo' is deprecated because it has a user-declared copy constructor" Bug: webrtc:11162 Change-Id: Ife3d1a800ed6a4cd08bdfd156cd0e320504ee8dd Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161221 Reviewed-by: Patrik Höglund Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#29984} --- api/audio/echo_canceller3_config.cc | 18 +++++++++++++++--- api/audio/echo_canceller3_config.h | 6 ++++++ rtc_base/ip_address.h | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/api/audio/echo_canceller3_config.cc b/api/audio/echo_canceller3_config.cc index f1d8881c76..49133568aa 100644 --- a/api/audio/echo_canceller3_config.cc +++ b/api/audio/echo_canceller3_config.cc @@ -43,17 +43,25 @@ bool Limit(int* value, int min, int max) { EchoCanceller3Config::EchoCanceller3Config() = default; EchoCanceller3Config::EchoCanceller3Config(const EchoCanceller3Config& e) = default; +EchoCanceller3Config& EchoCanceller3Config::operator=( + const EchoCanceller3Config& e) = default; EchoCanceller3Config::Delay::Delay() = default; EchoCanceller3Config::Delay::Delay(const EchoCanceller3Config::Delay& e) = default; +EchoCanceller3Config::Delay& EchoCanceller3Config::Delay::operator=( + const Delay& e) = default; EchoCanceller3Config::EchoModel::EchoModel() = default; EchoCanceller3Config::EchoModel::EchoModel( const EchoCanceller3Config::EchoModel& e) = default; +EchoCanceller3Config::EchoModel& EchoCanceller3Config::EchoModel::operator=( + const EchoModel& e) = default; EchoCanceller3Config::Suppressor::Suppressor() = default; EchoCanceller3Config::Suppressor::Suppressor( const EchoCanceller3Config::Suppressor& e) = default; +EchoCanceller3Config::Suppressor& EchoCanceller3Config::Suppressor::operator=( + const Suppressor& e) = default; EchoCanceller3Config::Suppressor::MaskingThresholds::MaskingThresholds( float enr_transparent, @@ -62,9 +70,11 @@ EchoCanceller3Config::Suppressor::MaskingThresholds::MaskingThresholds( : enr_transparent(enr_transparent), enr_suppress(enr_suppress), emr_transparent(emr_transparent) {} -EchoCanceller3Config::Suppressor::Suppressor::MaskingThresholds:: - MaskingThresholds( - const EchoCanceller3Config::Suppressor::MaskingThresholds& e) = default; +EchoCanceller3Config::Suppressor::MaskingThresholds::MaskingThresholds( + const EchoCanceller3Config::Suppressor::MaskingThresholds& e) = default; +EchoCanceller3Config::Suppressor::MaskingThresholds& +EchoCanceller3Config::Suppressor::MaskingThresholds::operator=( + const MaskingThresholds& e) = default; EchoCanceller3Config::Suppressor::Tuning::Tuning(MaskingThresholds mask_lf, MaskingThresholds mask_hf, @@ -76,6 +86,8 @@ EchoCanceller3Config::Suppressor::Tuning::Tuning(MaskingThresholds mask_lf, max_dec_factor_lf(max_dec_factor_lf) {} EchoCanceller3Config::Suppressor::Tuning::Tuning( const EchoCanceller3Config::Suppressor::Tuning& e) = default; +EchoCanceller3Config::Suppressor::Tuning& +EchoCanceller3Config::Suppressor::Tuning::operator=(const Tuning& e) = default; bool EchoCanceller3Config::Validate(EchoCanceller3Config* config) { RTC_DCHECK(config); diff --git a/api/audio/echo_canceller3_config.h b/api/audio/echo_canceller3_config.h index 4914225f69..a63318f1da 100644 --- a/api/audio/echo_canceller3_config.h +++ b/api/audio/echo_canceller3_config.h @@ -25,6 +25,7 @@ struct RTC_EXPORT EchoCanceller3Config { EchoCanceller3Config(); EchoCanceller3Config(const EchoCanceller3Config& e); + EchoCanceller3Config& operator=(const EchoCanceller3Config& other); struct Buffering { size_t excess_render_detection_interval_blocks = 250; @@ -34,6 +35,7 @@ struct RTC_EXPORT EchoCanceller3Config { struct Delay { Delay(); Delay(const Delay& e); + Delay& operator=(const Delay& e); size_t default_delay = 5; size_t down_sampling_factor = 4; size_t num_filters = 5; @@ -132,6 +134,7 @@ struct RTC_EXPORT EchoCanceller3Config { struct EchoModel { EchoModel(); EchoModel(const EchoModel& e); + EchoModel& operator=(const EchoModel& e); size_t noise_floor_hold = 50; float min_noise_floor_power = 1638400.f; float stationary_gate_slope = 10.f; @@ -144,6 +147,7 @@ struct RTC_EXPORT EchoCanceller3Config { struct Suppressor { Suppressor(); Suppressor(const Suppressor& e); + Suppressor& operator=(const Suppressor& e); size_t nearend_average_blocks = 4; @@ -152,6 +156,7 @@ struct RTC_EXPORT EchoCanceller3Config { float enr_suppress, float emr_transparent); MaskingThresholds(const MaskingThresholds& e); + MaskingThresholds& operator=(const MaskingThresholds& e); float enr_transparent; float enr_suppress; float emr_transparent; @@ -163,6 +168,7 @@ struct RTC_EXPORT EchoCanceller3Config { float max_inc_factor, float max_dec_factor_lf); Tuning(const Tuning& e); + Tuning& operator=(const Tuning& e); MaskingThresholds mask_lf; MaskingThresholds mask_hf; float max_inc_factor; diff --git a/rtc_base/ip_address.h b/rtc_base/ip_address.h index 3f63a91b42..5442fbd2a5 100644 --- a/rtc_base/ip_address.h +++ b/rtc_base/ip_address.h @@ -137,6 +137,7 @@ class RTC_EXPORT InterfaceAddress : public IPAddress { InterfaceAddress(const in6_addr& ip6, int ipv6_flags) : IPAddress(ip6), ipv6_flags_(ipv6_flags) {} + InterfaceAddress(const InterfaceAddress& other) = default; const InterfaceAddress& operator=(const InterfaceAddress& other); bool operator==(const InterfaceAddress& other) const;