From: Soeren Apel Date: Tue, 16 Feb 2016 20:15:03 +0000 (+0100) Subject: Use the 'default' keyword where applicable. This patch X-Git-Tag: pulseview-0.4.0~332 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c6246dc56ed01d7e99aa65ab88b8c191300b1ebd;p=pulseview.git Use the 'default' keyword where applicable. This patch was initially created using clang-tidy: clang-tidy -checks="-*,moderize-use-default" -fix However, the resulting patch only wanted to alter the definitions in the .cpp file. I think it makes more sense to remove the definitions completely and just add "= default" to the declarations in the header file. --- diff --git a/pv/data/signaldata.cpp b/pv/data/signaldata.cpp index 6a4c6d92..6baeac7c 100644 --- a/pv/data/signaldata.cpp +++ b/pv/data/signaldata.cpp @@ -23,9 +23,5 @@ namespace pv { namespace data { -SignalData::SignalData() -{ -} - } // namespace data } // namespace pv diff --git a/pv/data/signaldata.hpp b/pv/data/signaldata.hpp index ff30cf1a..4b356100 100644 --- a/pv/data/signaldata.hpp +++ b/pv/data/signaldata.hpp @@ -33,7 +33,7 @@ class Segment; class SignalData { public: - SignalData(); + SignalData() = default; virtual ~SignalData() {} public: diff --git a/pv/devicemanager.cpp b/pv/devicemanager.cpp index b11e60c7..41f2ae9c 100644 --- a/pv/devicemanager.cpp +++ b/pv/devicemanager.cpp @@ -65,10 +65,6 @@ DeviceManager::DeviceManager(shared_ptr context) : driver_scan(entry.second, map()); } -DeviceManager::~DeviceManager() -{ -} - const std::shared_ptr& DeviceManager::context() const { return context_; diff --git a/pv/devicemanager.hpp b/pv/devicemanager.hpp index 33e784de..d0d11cbd 100644 --- a/pv/devicemanager.hpp +++ b/pv/devicemanager.hpp @@ -50,7 +50,7 @@ class DeviceManager public: DeviceManager(std::shared_ptr context); - ~DeviceManager(); + ~DeviceManager() = default; const std::shared_ptr& context() const; diff --git a/pv/prop/bool.cpp b/pv/prop/bool.cpp index 3e201cc4..3281de78 100644 --- a/pv/prop/bool.cpp +++ b/pv/prop/bool.cpp @@ -33,10 +33,6 @@ Bool::Bool(QString name, Getter getter, Setter setter) : { } -Bool::~Bool() -{ -} - QWidget* Bool::get_widget(QWidget *parent, bool auto_commit) { if (check_box_) diff --git a/pv/prop/bool.hpp b/pv/prop/bool.hpp index 6d32da7e..dada54db 100644 --- a/pv/prop/bool.hpp +++ b/pv/prop/bool.hpp @@ -35,7 +35,7 @@ class Bool : public Property public: Bool(QString name, Getter getter, Setter setter); - virtual ~Bool(); + virtual ~Bool() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); bool labeled_widget() const; diff --git a/pv/prop/double.cpp b/pv/prop/double.cpp index c5ab1db4..f4e6e443 100644 --- a/pv/prop/double.cpp +++ b/pv/prop/double.cpp @@ -46,10 +46,6 @@ Double::Double(QString name, { } -Double::~Double() -{ -} - QWidget* Double::get_widget(QWidget *parent, bool auto_commit) { if (spin_box_) diff --git a/pv/prop/double.hpp b/pv/prop/double.hpp index b62d1fa6..dc119bdb 100644 --- a/pv/prop/double.hpp +++ b/pv/prop/double.hpp @@ -43,7 +43,7 @@ public: Getter getter, Setter setter); - virtual ~Double(); + virtual ~Double() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index 06e4d76f..71ed19e6 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -39,10 +39,6 @@ Enum::Enum(QString name, { } -Enum::~Enum() -{ -} - QWidget* Enum::get_widget(QWidget *parent, bool auto_commit) { if (selector_) diff --git a/pv/prop/enum.hpp b/pv/prop/enum.hpp index 63f78af0..0ae8a9c6 100644 --- a/pv/prop/enum.hpp +++ b/pv/prop/enum.hpp @@ -43,7 +43,7 @@ public: Enum(QString name, std::vector > values, Getter getter, Setter setter); - virtual ~Enum(); + virtual ~Enum() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); diff --git a/pv/prop/int.cpp b/pv/prop/int.cpp index e750e9fa..fd3bfe47 100644 --- a/pv/prop/int.cpp +++ b/pv/prop/int.cpp @@ -45,10 +45,6 @@ Int::Int(QString name, { } -Int::~Int() -{ -} - QWidget* Int::get_widget(QWidget *parent, bool auto_commit) { int64_t int_val = 0, range_min = 0; diff --git a/pv/prop/int.hpp b/pv/prop/int.hpp index 60c9d513..baf7dd7e 100644 --- a/pv/prop/int.hpp +++ b/pv/prop/int.hpp @@ -41,7 +41,7 @@ public: boost::optional< std::pair > range, Getter getter, Setter setter); - virtual ~Int(); + virtual ~Int() = default; QWidget* get_widget(QWidget *parent, bool auto_commit); diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 2597a8f3..30cf5abf 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -66,10 +66,6 @@ AnalogSignal::AnalogSignal( set_colour(SignalColours[channel_->index() % countof(SignalColours)]); } -AnalogSignal::~AnalogSignal() -{ -} - shared_ptr AnalogSignal::data() const { return data_; diff --git a/pv/view/analogsignal.hpp b/pv/view/analogsignal.hpp index 938d92d5..06867a55 100644 --- a/pv/view/analogsignal.hpp +++ b/pv/view/analogsignal.hpp @@ -47,7 +47,7 @@ public: std::shared_ptr channel, std::shared_ptr data); - virtual ~AnalogSignal(); + virtual ~AnalogSignal() = default; std::shared_ptr data() const; diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 78bfdec5..5584a1fc 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -126,10 +126,6 @@ LogicSignal::LogicSignal( trigger_match_ = match->type(); } -LogicSignal::~LogicSignal() -{ -} - shared_ptr LogicSignal::data() const { return data_; diff --git a/pv/view/logicsignal.hpp b/pv/view/logicsignal.hpp index d34b65e7..fc0dcabb 100644 --- a/pv/view/logicsignal.hpp +++ b/pv/view/logicsignal.hpp @@ -69,7 +69,7 @@ public: std::shared_ptr channel, std::shared_ptr data); - virtual ~LogicSignal(); + virtual ~LogicSignal() = default; std::shared_ptr data() const;