berndporr / iir1

DSP IIR realtime filter library written in C++
http://berndporr.github.io/iir1/
MIT License
627 stars 137 forks source link

Cleanup minor GCC and MSVC warnings #34

Closed kcgen closed 2 years ago

kcgen commented 2 years ago

@berndporr , thanks for considering this PR.

I've confirmed that this cleans up all our warnings across all compilers:

In the spirit of being explicit, I'm using the literal notation for the types:

For casual readers, things like the following become obvious that the variables are doubles:

m_v1 = 0.0;
m_v2 = 0.0;

Also, with the default initializers in TransposedDirectFormII, the reset() call in its constructor is no longer needed. And instead of implementing a placeholder constructor, used the recommended C++11 notation instead:

TransposedDirectFormII() = default;

(happy to remove that and go back to reset(), if desired).

berndporr commented 2 years ago

Thanks. In terms of the default constructor there were three other places where the default constructor replaces reset(). Also the complex conjugate pair can directly initialised by the default constructor of the pair which in turn has default values... ;)

kcgen commented 2 years ago

In terms of the default constructor there were three other places where the default constructor replaces reset().

Right on; thanks for catching those loose ends from this PR :+1:

Also the complex conjugate pair can directly initialised by the default constructor of the pair which in turn has default values... ;)

Ahh, even tidier!

Thanks again, @berndporr!