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

@@ -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)