1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-04 18:53:24 +01:00

Clean up some dead code and MSVC warnings.

- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
This commit is contained in:
James Crook
2017-12-08 11:26:09 +00:00
parent b63e61d8e9
commit f463eda36c
68 changed files with 216 additions and 510 deletions

View File

@@ -297,7 +297,7 @@ Mixer::Mixer(const WaveTrackConstArray &inputTracks,
mBuffer.reinit(mNumBuffers);
mTemp.reinit(mNumBuffers);
for (int c = 0; c < mNumBuffers; c++) {
for (unsigned int c = 0; c < mNumBuffers; c++) {
mBuffer[c].Allocate(mInterleavedBufferSize, mFormat);
mTemp[c].Allocate(mInterleavedBufferSize, floatSample);
}
@@ -355,7 +355,7 @@ void Mixer::ApplyTrackGains(bool apply)
void Mixer::Clear()
{
for (int c = 0; c < mNumBuffers; c++) {
for (unsigned int c = 0; c < mNumBuffers; c++) {
memset(mTemp[c].ptr(), 0, mInterleavedBufferSize * SAMPLE_SIZE(floatSample));
}
}
@@ -364,7 +364,7 @@ void MixBuffers(unsigned numChannels, int *channelFlags, float *gains,
samplePtr src, SampleBuffer *dests,
int len, bool interleaved)
{
for (int c = 0; c < numChannels; c++) {
for (unsigned int c = 0; c < numChannels; c++) {
if (!channelFlags[c])
continue;
@@ -426,7 +426,7 @@ size_t Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
(backwards ? *queueLen : - *queueLen)) / trackRate;
while (out < mMaxOut) {
if (*queueLen < mProcessLen) {
if (*queueLen < (int)mProcessLen) {
// Shift pending portion to start of the buffer
memmove(queue, &queue[*queueStart], (*queueLen) * sampleSize);
*queueStart = 0;
@@ -477,7 +477,7 @@ size_t Mixer::MixVariableRates(int *channelFlags, WaveTrackCache &cache,
}
auto thisProcessLen = mProcessLen;
bool last = (*queueLen < mProcessLen);
bool last = (*queueLen < (int)mProcessLen);
if (last) {
thisProcessLen = *queueLen;
}
@@ -747,8 +747,8 @@ MixerSpec::MixerSpec( unsigned numTracks, unsigned maxNumChannels )
Alloc();
for( int i = 0; i < mNumTracks; i++ )
for( int j = 0; j < mNumChannels; j++ )
for( unsigned int i = 0; i < mNumTracks; i++ )
for( unsigned int j = 0; j < mNumChannels; j++ )
mMap[ i ][ j ] = ( i == j );
}
@@ -760,8 +760,8 @@ MixerSpec::MixerSpec( const MixerSpec &mixerSpec )
Alloc();
for( int i = 0; i < mNumTracks; i++ )
for( int j = 0; j < mNumChannels; j++ )
for( unsigned int i = 0; i < mNumTracks; i++ )
for( unsigned int j = 0; j < mNumChannels; j++ )
mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
}
@@ -782,12 +782,12 @@ bool MixerSpec::SetNumChannels( unsigned newNumChannels )
if( newNumChannels > mMaxNumChannels )
return false;
for( int i = 0; i < mNumTracks; i++ )
for( unsigned int i = 0; i < mNumTracks; i++ )
{
for( int j = newNumChannels; j < mNumChannels; j++ )
for( unsigned int j = newNumChannels; j < mNumChannels; j++ )
mMap[ i ][ j ] = false;
for( int j = mNumChannels; j < newNumChannels; j++ )
for( unsigned int j = mNumChannels; j < newNumChannels; j++ )
mMap[ i ][ j ] = false;
}
@@ -803,8 +803,8 @@ MixerSpec& MixerSpec::operator=( const MixerSpec &mixerSpec )
Alloc();
for( int i = 0; i < mNumTracks; i++ )
for( int j = 0; j < mNumChannels; j++ )
for( unsigned int i = 0; i < mNumTracks; i++ )
for( unsigned int j = 0; j < mNumChannels; j++ )
mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
return *this;