cycfi / q

C++ Library for Audio Digital Signal Processing
MIT License
1.12k stars 146 forks source link

Fix type of parameter in dc_block::operator= function #64

Closed propeller3D closed 1 year ago

propeller3D commented 1 year ago

This pull request addresses a type mismatch issue in the dc_block::operator= function.

In the current implementation, the operator= function is declared to take a bool parameter. However it should accept a float instead.

Change the bool parameter type in dc_block::operator= to float.

djowel commented 1 year ago

Can you also 'fix' the docs? It's just a text file *.adoc

djowel commented 1 year ago

Oh, please update to the latest develop and update the PR to fix the gcc build problem.

propeller3D commented 1 year ago

I have changed it now but I have another question before I continue. The parameter is "dcblock::operator=(float y)" but everywhere else you seem to be using "_y". Should I change this as well? I assume that you are using it to differentiate the parameter from the output value y. This is the case in the adoc as well.

djowel commented 1 year ago

I have changed it now but I have another question before I continue. The parameter is "dcblock::operator=(float y)" but everywhere else you seem to be using "_y". Should I change this as well? I assume that you are using it to differentiate the parameter from the output value y. This is the case in the adoc as well.

Oh good point! Please do! :-)

Edit: Ah wait, no. I use y_ for arguments that clash with member variables. But for API documentation, it's better to just have it as y, since the member variables are hidden and private anyway.

Had a look at where in the documentation. Likewise, in those cases, it's better to just use y (in quick-start). That being _y is probably an artifact of its prior use as a member variable.

Edit2: Oh, and indeed it is a member variable! It is not an artifact.

djowel commented 1 year ago

Merged! Thank you!

propeller3D commented 1 year ago

I didn’t change the y_ in the code. You closed just before I tried to push the latest. I only changed from bool to float in the declaration, the implementation and in the documentation of the dc_block operator =

djowel commented 1 year ago

I didn’t change the y_ in the code. You closed just before I tried to push the latest. I only changed from bool to float in the declaration, the implementation and in the documentation of the dc_block operator =

It's OK. I'll do it here. Many thanks!

djowel commented 1 year ago

Done :-)