From 70451623a766f8000f82f1ed602d55a5de89a8db Mon Sep 17 00:00:00 2001 From: Markus Schmidl Date: Thu, 16 May 2024 20:12:50 +0200 Subject: [PATCH] fix compile warnings --- include/config.h | 19 +++++++------------ src/config.cpp | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/config.h b/include/config.h index 2fe4f32..26991e9 100644 --- a/include/config.h +++ b/include/config.h @@ -1,14 +1,14 @@ #ifndef CONFIG_H #define CONFIG_H +#include #include +#include #include #include -#include #include -#include -#include #include +#include #include @@ -65,16 +65,11 @@ template class SpectrumSlice { , frequency_range_(center_frequency - sample_rate / 2, center_frequency + sample_rate / 2) , sample_rate_(sample_rate){}; - friend auto operator==(const SpectrumSlice&, const SpectrumSlice&) -> bool; - friend auto operator!=(const SpectrumSlice&, const SpectrumSlice&) -> bool; -}; - -template auto operator==(const SpectrumSlice& lhs, const SpectrumSlice& rhs) -> bool { - return lhs.center_frequency_ == rhs.center_frequency_ && lhs.sample_rate_ == rhs.sample_rate_; -}; + friend auto operator==(const SpectrumSlice& lhs, const SpectrumSlice& rhs) -> bool { + return lhs.center_frequency_ == rhs.center_frequency_ && lhs.sample_rate_ == rhs.sample_rate_; + }; -template auto operator!=(const SpectrumSlice& lhs, const SpectrumSlice& rhs) -> bool { - return !operator==(lhs, rhs); + friend auto operator!=(const SpectrumSlice& lhs, const SpectrumSlice& rhs) -> bool { return !(lhs == rhs); }; }; class Stream { diff --git a/src/config.cpp b/src/config.cpp index 631382b..553c539 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -61,12 +61,12 @@ TopLevel::TopLevel(const SpectrumSlice& spectrum, std::string devi , streams_(streams) , decimators_(decimators) { for (const auto& stream : streams) { - if (operator!=(stream.input_spectrum_, spectrum)) { + if (stream.input_spectrum_ != spectrum) { throw std::invalid_argument("The output of Decimate does not match to the input of Stream."); } } for (const auto& decimator : decimators) { - if (operator!=(decimator.input_spectrum_, spectrum)) { + if (decimator.input_spectrum_ != spectrum) { throw std::invalid_argument("The output of Decimate does not match to the input of Stream."); } }