Don't use conversion of sampleCount to bool

This commit is contained in:
Paul Licameli 2016-08-22 15:04:15 -04:00
parent 69064edf20
commit 39df8d0b51
4 changed files with 9 additions and 9 deletions

View File

@ -667,7 +667,7 @@ bool Sequence::InsertSilence(sampleCount s0, sampleCount len)
pos += idealSamples; pos += idealSamples;
len -= idealSamples; len -= idealSamples;
} }
if (len) { if (len != 0) {
sTrack.mBlock.push_back(SeqBlock( sTrack.mBlock.push_back(SeqBlock(
make_blockfile<SilentBlockFile>(len), pos)); make_blockfile<SilentBlockFile>(len), pos));
pos += len; pos += len;
@ -1186,7 +1186,7 @@ bool Sequence::Set(samplePtr buffer, sampleFormat format,
int b = FindBlock(start); int b = FindBlock(start);
while (len) { while (len != 0) {
SeqBlock &block = mBlock[b]; SeqBlock &block = mBlock[b];
const sampleCount bstart = start - block.start; const sampleCount bstart = start - block.start;
const sampleCount fileLength = block.f->GetLength(); const sampleCount fileLength = block.f->GetLength();

View File

@ -1580,10 +1580,10 @@ bool Effect::ProcessTrack(int count,
} }
// Call the effect until we run out of input or delayed samples // Call the effect until we run out of input or delayed samples
while (inputRemaining || delayRemaining) while (inputRemaining != 0 || delayRemaining != 0)
{ {
// Still working on the input samples // Still working on the input samples
if (inputRemaining) if (inputRemaining != 0)
{ {
// Need to refill the input buffers // Need to refill the input buffers
if (inputBufferCnt == 0) if (inputBufferCnt == 0)
@ -1629,7 +1629,7 @@ bool Effect::ProcessTrack(int count,
} }
// Might be able to use up some of the delayed samples // Might be able to use up some of the delayed samples
if (delayRemaining) if (delayRemaining != 0)
{ {
// Don't use more than needed // Don't use more than needed
if (delayRemaining < cnt) if (delayRemaining < cnt)
@ -1642,7 +1642,7 @@ bool Effect::ProcessTrack(int count,
} }
} }
// We've exhausted the input samples and are now working on the delay // We've exhausted the input samples and are now working on the delay
else if (delayRemaining) else if (delayRemaining != 0)
{ {
// Calculate the number of samples to process // Calculate the number of samples to process
curBlockSize = mBlockSize; curBlockSize = mBlockSize;
@ -1684,7 +1684,7 @@ bool Effect::ProcessTrack(int count,
wxUnusedVar(processed); wxUnusedVar(processed);
// Bump to next input buffer position // Bump to next input buffer position
if (inputRemaining) if (inputRemaining != 0)
{ {
for (int i = 0; i < mNumChannels; i++) for (int i = 0; i < mNumChannels; i++)
{ {

View File

@ -1084,7 +1084,7 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
int wcopy = 0; int wcopy = 0;
int offset = (mM - 1)/2; int offset = (mM - 1)/2;
while(len) while (len != 0)
{ {
sampleCount block = idealBlockLen; sampleCount block = idealBlockLen;
if (block > len) if (block > len)

View File

@ -496,7 +496,7 @@ bool VampEffect::Process()
sampleCount ls = lstart; sampleCount ls = lstart;
sampleCount rs = rstart; sampleCount rs = rstart;
while (len) while (len != 0)
{ {
int request = block; int request = block;
if (request > len) request = len; if (request > len) request = len;