From 205b9d4aec60c60f91ae9f38c8fb9ad9b67eadcf Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 18 May 2017 16:49:02 -0700 Subject: [PATCH] Fix compiler warnings --- libraries/audio/src/AudioDynamics.h | 4 ++-- libraries/audio/src/AudioGate.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/audio/src/AudioDynamics.h b/libraries/audio/src/AudioDynamics.h index 4c2f890c67..08daa21348 100644 --- a/libraries/audio/src/AudioDynamics.h +++ b/libraries/audio/src/AudioDynamics.h @@ -56,12 +56,12 @@ static const double FIXQ31 = 2147483648.0; // convert float to Q31 static const double DB_TO_LOG2 = 0.16609640474436813; // convert dB to log2 // convert dB to amplitude -static double dBToGain(double dB) { +static inline double dBToGain(double dB) { return pow(10.0, dB / 20.0); } // convert milliseconds to first-order time constant -static int32_t msToTc(double ms, double sampleRate) { +static inline int32_t msToTc(double ms, double sampleRate) { double tc = exp(-1000.0 / (ms * sampleRate)); return (int32_t)(FIXQ31 * tc); // Q31 } diff --git a/libraries/audio/src/AudioGate.cpp b/libraries/audio/src/AudioGate.cpp index cd49b90245..737e2359f1 100644 --- a/libraries/audio/src/AudioGate.cpp +++ b/libraries/audio/src/AudioGate.cpp @@ -187,7 +187,7 @@ void GateImpl::setHold(float hold) { _holdInc = (int32_t)((_holdMin - 0x7fffffff) / (PROGHOLD * _sampleRate)); _holdInc = MIN(_holdInc, -1); // prevent 0 on long releases - _holdMax = 0x7fffffff - (uint32_t)(_holdInc * hold/1000.0 * _sampleRate); + _holdMax = 0x7fffffff - (uint32_t)(_holdInc * (double)hold/1000.0 * _sampleRate); } // @@ -196,7 +196,7 @@ void GateImpl::setHold(float hold) { void GateImpl::setHysteresis(float hysteresis) { // gate hysteresis in log2 domain - _hysteresis = (int32_t)(hysteresis * DB_TO_LOG2 * (1 << LOG2_FRACBITS)); + _hysteresis = (int32_t)((double)hysteresis * DB_TO_LOG2 * (1 << LOG2_FRACBITS)); } //