Avoid some compiler warnings

This commit is contained in:
Chris Cannam
2020-09-16 17:47:30 +01:00
parent be843f3da7
commit 438893fb6f
5 changed files with 28 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ HighFrequencyAudioCurve::reset()
}
float
HighFrequencyAudioCurve::processFloat(const float *R__ mag, int increment)
HighFrequencyAudioCurve::processFloat(const float *R__ mag, int)
{
float result = 0.0;
@@ -56,7 +56,7 @@ HighFrequencyAudioCurve::processFloat(const float *R__ mag, int increment)
}
double
HighFrequencyAudioCurve::processDouble(const double *R__ mag, int increment)
HighFrequencyAudioCurve::processDouble(const double *R__ mag, int)
{
float result = 0.0;

View File

@@ -58,7 +58,7 @@ PercussiveAudioCurve::setFftSize(int newSize)
}
float
PercussiveAudioCurve::processFloat(const float *R__ mag, int increment)
PercussiveAudioCurve::processFloat(const float *R__ mag, int)
{
static float threshold = powf(10.f, 0.15f); // 3dB rise in square of magnitude
static float zeroThresh = powf(10.f, -8);
@@ -84,7 +84,7 @@ PercussiveAudioCurve::processFloat(const float *R__ mag, int increment)
}
double
PercussiveAudioCurve::processDouble(const double *R__ mag, int increment)
PercussiveAudioCurve::processDouble(const double *R__ mag, int)
{
static double threshold = pow(10., 0.15); // 3dB rise in square of magnitude
static double zeroThresh = pow(10., -8);

View File

@@ -62,7 +62,7 @@ SpectralDifferenceAudioCurve::setFftSize(int newSize)
}
float
SpectralDifferenceAudioCurve::processFloat(const float *R__ mag, int increment)
SpectralDifferenceAudioCurve::processFloat(const float *R__ mag, int)
{
double result = 0.0;
@@ -83,7 +83,7 @@ SpectralDifferenceAudioCurve::processFloat(const float *R__ mag, int increment)
}
double
SpectralDifferenceAudioCurve::processDouble(const double *R__ mag, int increment)
SpectralDifferenceAudioCurve::processDouble(const double *R__ mag, int)
{
double result = 0.0;

View File

@@ -271,9 +271,13 @@ T **reallocate_channels(T **ptr,
{
T **newptr = allocate_channels<T>(channels, count);
if (oldcount && ptr) {
v_copy_channels(newptr, ptr, channels, oldcount < count ? oldcount : count);
for (size_t c = 0; c < oldchannels && c < channels; ++c) {
for (size_t i = 0; i < oldcount && i < count; ++i) {
newptr[c][i] = ptr[c][i];
}
}
}
if (ptr) deallocate_channels<T>(ptr, channels);
if (ptr) deallocate_channels<T>(ptr, oldchannels);
return newptr;
}
@@ -284,9 +288,13 @@ T **reallocate_and_zero_extend_channels(T **ptr,
{
T **newptr = allocate_and_zero_channels<T>(channels, count);
if (oldcount && ptr) {
v_copy_channels(newptr, ptr, channels, oldcount < count ? oldcount : count);
for (size_t c = 0; c < oldchannels && c < channels; ++c) {
for (size_t i = 0; i < oldcount && i < count; ++i) {
newptr[c][i] = ptr[c][i];
}
}
}
if (ptr) deallocate_channels<T>(ptr, channels);
if (ptr) deallocate_channels<T>(ptr, oldchannels);
return newptr;
}

View File

@@ -200,7 +200,11 @@ Mutex::trylock()
}
}
Condition::Condition(string name) :
Condition::Condition(string
#ifdef DEBUG_CONDITION
name
#endif
) :
m_locked(false)
#ifdef DEBUG_CONDITION
, m_name(name)
@@ -456,7 +460,11 @@ Mutex::trylock()
}
}
Condition::Condition(string name) :
Condition::Condition(string
#ifdef DEBUG_CONDITION
name
#endif
) :
m_locked(false)
#ifdef DEBUG_CONDITION
, m_name(name)