BlockLowPass: initialize state in definition

This commit is contained in:
Matthias Grob 2021-01-21 16:06:26 +01:00 committed by Daniel Agar
parent 82d32c7f3f
commit 4ce4fe05c5

View File

@ -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;
};