Changed the templates and loops to size_t in

AudioBuffer and AudioSpan
This commit is contained in:
Paul Ferrand 2020-01-05 10:09:25 +01:00
parent 391b2dc2e4
commit 2c2c31f542
2 changed files with 8 additions and 8 deletions

View file

@ -70,7 +70,7 @@ public:
: numChannels(numChannels)
, numFrames(numFrames)
{
for (auto i = 0; i < numChannels; ++i)
for (size_t i = 0; i < numChannels; ++i)
buffers[i] = std::make_unique<buffer_type>(numFrames);
}
@ -85,7 +85,7 @@ public:
{
bool returnedOK = true;
for (auto i = 0; i < numChannels; ++i)
for (size_t i = 0; i < numChannels; ++i)
returnedOK &= buffers[i]->resize(newSize);
if (returnedOK)

View file

@ -107,7 +107,7 @@ public:
, numChannels(numChannels)
{
ASSERT(numChannels <= MaxChannels);
for (auto i = 0; i < numChannels; ++i)
for (size_t i = 0; i < numChannels; ++i)
this->spans[i] = spans[i] + offset;
}
@ -164,7 +164,7 @@ public:
* @tparam Alignment the alignment block size for the platform
* @param audioBuffer the source AudioBuffer.
*/
template <class U, int N, unsigned int Alignment, typename = std::enable_if<N <= MaxChannels>, typename = std::enable_if_t<std::is_const<U>::value, int>>
template <class U, size_t N, unsigned int Alignment, typename = std::enable_if<N <= MaxChannels>, typename = std::enable_if_t<std::is_const<U>::value, int>>
AudioSpan(AudioBuffer<U, N, Alignment>& audioBuffer)
: numFrames(audioBuffer.getNumFrames())
, numChannels(audioBuffer.getNumChannels())
@ -185,7 +185,7 @@ public:
* @tparam Alignment the alignment block size for the platform
* @param audioBuffer the source AudioBuffer.
*/
template <class U, int N, unsigned int Alignment, typename = std::enable_if<N <= MaxChannels>>
template <class U, size_t N, unsigned int Alignment, typename = std::enable_if<N <= MaxChannels>>
AudioSpan(AudioBuffer<U, N, Alignment>& audioBuffer)
: numFrames(audioBuffer.getNumFrames())
, numChannels(audioBuffer.getNumChannels())
@ -200,7 +200,7 @@ public:
*
* @param other the other AudioSpan
*/
template <class U, int N, typename = std::enable_if<N <= MaxChannels>>
template <class U, size_t N, typename = std::enable_if<N <= MaxChannels>>
AudioSpan(const AudioSpan<U, N>& other)
: numFrames(other.getNumFrames())
, numChannels(other.getNumChannels())
@ -312,7 +312,7 @@ public:
*
* @param other the other AudioSpan
*/
template <class U, int N, typename = std::enable_if<N <= MaxChannels>>
template <class U, size_t N, typename = std::enable_if<N <= MaxChannels>>
void add(AudioSpan<U, N>& other)
{
static_assert(!std::is_const<Type>::value, "Can't allow mutating operations on const AudioSpans");
@ -329,7 +329,7 @@ public:
*
* @param other the other AudioSpan
*/
template <class U, int N, typename = std::enable_if<N <= MaxChannels>>
template <class U, size_t N, typename = std::enable_if<N <= MaxChannels>>
void copy(AudioSpan<U, N>& other)
{
static_assert(!std::is_const<Type>::value, "Can't allow mutating operations on const AudioSpans");