Fixed compiler errors that result from defining DSP_SAMPLE_FLOAT #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses the compiler errors that result from using the
DSP_SAMPLE_FLOAT
definition.Some of the dsp modules explicitly use the
double
keyword on template parameters, function argument, return types etc.This becomes a problem when the
DSP_SAMPLE_FLOAT
macro is defined as some compilers complain about not being able to convert floats to doubles (which makes sense in some cases since float variables and pointers are being passed to function calls that are expecting doubles).More specifically these errors occur for:
The
IpulseResponse
classProcess
function expects and returns double pointers.The
mGainReductionDB
vector declaration in line 127 ofNoiseGate.h
in theTrigger
class, has a template parameter of double while theGetGainReduction()
function in line 93 is returning a vector of typeDSP_SAMPLE
which would be float in the case of the DSP_SAMPLE_FLOAT definition.I'm not sure if there was a specific reason for the ImpulseResponse class to be explicitly using double precision when the other classes including the base DSP are using the macro, but this change shouldn't be too invasive since everything is defaulting to double.
I hope it's ok that I didn't open an issue first, I didn't think it was needed since the changes are pretty small...