From 825d10c81a7479e71d8cfb9b0a88b046afa815de Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Mon, 9 Nov 2015 15:21:35 -0200 Subject: [PATCH] Filter: remove filter with double type We are currently not using LowPassFilter2p and it just generates a lot of warnings on PX4 while instantiating it due to implicitly promoting float to double: libraries/Filter/LowPassFilter2p.cpp: In instantiation of 'T DigitalBiquadFilter::apply(const T&, const DigitalBiquadFilter::biquad_params&) [with T = double]': libraries/Filter/LowPassFilter2p.cpp:86:41: required from 'T LowPassFilter2p::apply(const T&) [with T = double]' libraries/Filter/LowPassFilter2p.cpp:98:16: required from here libraries/Filter/LowPassFilter2p.cpp:20:82: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion] T delay_element_0 = sample - _delay_element_1 * params.a1 - _delay_element_2 * params.a2; ^ --- libraries/Filter/LowPassFilter2p.cpp | 1 - libraries/Filter/LowPassFilter2p.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/Filter/LowPassFilter2p.cpp b/libraries/Filter/LowPassFilter2p.cpp index dd963d5644..d2de3c888e 100644 --- a/libraries/Filter/LowPassFilter2p.cpp +++ b/libraries/Filter/LowPassFilter2p.cpp @@ -93,6 +93,5 @@ T LowPassFilter2p::apply(const T &sample) { template class LowPassFilter2p; template class LowPassFilter2p; template class LowPassFilter2p; -template class LowPassFilter2p; template class LowPassFilter2p; template class LowPassFilter2p; diff --git a/libraries/Filter/LowPassFilter2p.h b/libraries/Filter/LowPassFilter2p.h index bab01c599e..95126923c2 100644 --- a/libraries/Filter/LowPassFilter2p.h +++ b/libraries/Filter/LowPassFilter2p.h @@ -88,9 +88,8 @@ LowPassFilter2p::LowPassFilter2p(float sample_freq, float cutoff_freq) { typedef LowPassFilter2p LowPassFilter2pInt; typedef LowPassFilter2p LowPassFilter2pLong; typedef LowPassFilter2p LowPassFilter2pFloat; -typedef LowPassFilter2p LowPassFilter2pDouble; typedef LowPassFilter2p LowPassFilter2pVector2f; typedef LowPassFilter2p LowPassFilter2pVector3f; -#endif // LOWPASSFILTER2P_H \ No newline at end of file +#endif // LOWPASSFILTER2P_H