From: Soeren Apel Date: Tue, 14 Mar 2017 21:54:20 +0000 (+0100) Subject: SignalBase: Allow checking for logic data directly X-Git-Tag: pulseview-0.4.0~140 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fe7d6661d5f520279e9d54067ad096fa4a6424c5;p=pulseview.git SignalBase: Allow checking for logic data directly If we always return a valid pointer, we need to look at the channel type to figure out if this data is supposed to be valid or not. This isn't useful. --- diff --git a/pv/data/signalbase.cpp b/pv/data/signalbase.cpp index ccdc1da7..e29bbe87 100644 --- a/pv/data/signalbase.cpp +++ b/pv/data/signalbase.cpp @@ -122,7 +122,7 @@ shared_ptr SignalBase::analog_data() const if (channel_type_ == AnalogChannel) return dynamic_pointer_cast(data_); else - return shared_ptr(); + return nullptr; } shared_ptr SignalBase::logic_data() const @@ -130,7 +130,7 @@ shared_ptr SignalBase::logic_data() const if (channel_type_ == LogicChannel) return dynamic_pointer_cast(data_); else - return shared_ptr(); + return nullptr; } #ifdef ENABLE_DECODE