From 4ce4fe05c53f55a4ebf7ff836807e12ea57ac8bd Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Thu, 21 Jan 2021 16:06:26 +0100 Subject: [PATCH] BlockLowPass: initialize state in definition --- src/lib/controllib/BlockLowPass.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/controllib/BlockLowPass.hpp b/src/lib/controllib/BlockLowPass.hpp index 492e364380..2beebf3c8b 100644 --- a/src/lib/controllib/BlockLowPass.hpp +++ b/src/lib/controllib/BlockLowPass.hpp @@ -66,7 +66,6 @@ public: // methods BlockLowPass(SuperBlock *parent, const char *name) : Block(parent, name), - _state(NAN /* initialize to invalid val, force into is_finite() check on first call */), _fCut(this, "") // only one parameter, no need to name {} virtual ~BlockLowPass() = default; @@ -77,7 +76,7 @@ public: void setState(float state) { _state = state; } protected: // attributes - float _state; + float _state{NAN}; // initialize to invalid val, force into is_finite() check on first call control::BlockParamFloat _fCut; };