Hi, See attached my patch of many minor problems which were causing compiler warnings.
Murray
Index: CLAM/src/Tools/SDIF/SDIFMatrix.hxx =================================================================== --- CLAM/src/Tools/SDIF/SDIFMatrix.hxx (revision 15134) +++ CLAM/src/Tools/SDIF/SDIFMatrix.hxx (working copy) @@ -73,7 +73,7 @@ CLAM::TUInt32 nElems = mHeader.mnColumns*mHeader.mnRows; CLAM::TUInt32 elemSize = mHeader.mDataType&0xFF; CLAM::TUInt32 size = nElems*elemSize; - CLAM::TUInt32 padding = 8-size&7; + CLAM::TUInt32 padding = 8-(size&7); return mHeader.SizeInFile()+size+padding; } Index: CLAM/src/Tools/SDIF/SDIFFile.cxx =================================================================== --- CLAM/src/Tools/SDIF/SDIFFile.cxx (revision 15134) +++ CLAM/src/Tools/SDIF/SDIFFile.cxx (working copy) @@ -315,7 +315,7 @@ { CLAM::TUInt32 size = matrix.mHeader.mnColumns*matrix.mHeader.mnRows* ((matrix.mHeader.mDataType)&0xFF); - CLAM::TUInt32 padding = 8-size&7; + CLAM::TUInt32 padding = 8-(size&7); Pos(Pos()+size+padding); } @@ -427,7 +427,7 @@ CLAM::TUInt32 elemSize = matrix.mHeader.mDataType&0xFF; CLAM::TUInt32 size = nElems*elemSize; - CLAM::TUInt32 padding = 8-size&7; + CLAM::TUInt32 padding = 8-(size&7); matrix.Resize(nElems); matrix.SetSize(nElems); @@ -445,7 +445,7 @@ CLAM::TUInt32 elemSize = matrix.mHeader.mDataType&0xFF; CLAM::TUInt32 size = nElems*elemSize; - CLAM::TUInt32 padding = 8-size&7; + CLAM::TUInt32 padding = 8-(size&7); CLAM::TByte tmp[1024]; const CLAM::TByte *ptr = (const CLAM::TByte*) const_cast<Matrix&>(matrix).GetPtr(); Index: CLAM/src/System/Threads/ThreadPool.cxx =================================================================== --- CLAM/src/System/Threads/ThreadPool.cxx (revision 15134) +++ CLAM/src/System/Threads/ThreadPool.cxx (working copy) @@ -24,7 +24,7 @@ Mutex::ScopedLock lock( dequeMutex ); // First we stop and delete all the busy threads - for (int counter = 0; counter < busyThreads.size(); counter++) + for (unsigned counter = 0; counter < busyThreads.size(); counter++) { PooledThread* threadPtr = busyThreads.at( counter ); if (threadPtr != NULL) @@ -37,7 +37,7 @@ busyThreads.clear(); // Next we delete all the idle threads - for (int counter = 0; counter < idleThreads.size(); counter++) + for (unsigned counter = 0; counter < idleThreads.size(); counter++) { PooledThread* threadPtr = idleThreads.at( counter ); Index: CLAM/src/Data/BasicProcessing/SpectralPeakArray.cxx =================================================================== --- CLAM/src/Data/BasicProcessing/SpectralPeakArray.cxx (revision 15134) +++ CLAM/src/Data/BasicProcessing/SpectralPeakArray.cxx (working copy) @@ -575,12 +575,12 @@ int origIndex=0,inIndex=0; DataArray& inPeakMagArray = in.GetMagBuffer(); DataArray& inPeakFreqArray = in.GetFreqBuffer(); - DataArray& inPeakPhaseArray = in.GetPhaseBuffer(); + DataArray& inPeakPhaseArray = in.GetPhaseBuffer(); // Why is inPeakMagArray used below, instead of inPeakPhaseArray? IndexArray& inPeakIndexArray = in.GetIndexArray(); DataArray& origPeakMagArray = GetMagBuffer(); DataArray& origPeakFreqArray = GetFreqBuffer(); - DataArray& origPeakPhaseArray = GetPhaseBuffer(); + DataArray& origPeakPhaseArray = GetPhaseBuffer(); // Why is origPeakMagArray used below, instead of origPeakPhaseArray? IndexArray& origPeakIndexArray = GetIndexArray(); DataArray& tmpPeakMagArray = tmp.GetMagBuffer(); Index: CLAM/src/audiofileio/codecs/MpegAudioStream.cxx =================================================================== --- CLAM/src/audiofileio/codecs/MpegAudioStream.cxx (revision 15134) +++ CLAM/src/audiofileio/codecs/MpegAudioStream.cxx (working copy) @@ -223,9 +223,9 @@ if (filePos >= previousFrameFilePos) break; } mBitstream.SynthesizeCurrent(); +/* + unsigned long filePos = mBitstream.CurrentFrameFileOffset(); - unsigned long filePos = mBitstream.CurrentFrameFileOffset(); -/* std::cout << "Jump n target: " << _mp3Frame << " " << targetMp3Frame << " " Index: CLAM/src/Processing/Plugins/LadspaProcessingExporter.cxx =================================================================== --- CLAM/src/Processing/Plugins/LadspaProcessingExporter.cxx (revision 15134) +++ CLAM/src/Processing/Plugins/LadspaProcessingExporter.cxx (working copy) @@ -170,14 +170,14 @@ void ProcessingClass2LadspaBase::SetPortSizes(int size) { - for(int i=0;i<_nInControls;i++) + for(unsigned i=0;i<_nInControls;i++) { if(_proc->GetInPort(i).GetSize() == size ) continue; _proc->GetInPort(i).SetSize( size ); mWrappersList[i]->SetSize( size ); } - for(int i=0;i<_nOutPorts;i++) + for(unsigned i=0;i<_nOutPorts;i++) { if(_proc->GetOutPort(i).GetSize() == size ) continue; _proc->GetOutPort(i).SetSize( size ); @@ -186,14 +186,14 @@ void ProcessingClass2LadspaBase::DoProc(unsigned long nSamples) { - for(int i=0;i<_nInPorts;i++) + for(unsigned i=0;i<_nInPorts;i++) { memcpy( &(mWrappersList[i]->GetData()), _inportBuffers[i], nSamples*sizeof(CLAM::TData) ); mWrappersList[i]->Produce(); } std::vector<CLAM::TData*> dataList(_nOutPorts); - for(int i=0;i<_nOutPorts;i++) + for(unsigned i=0;i<_nOutPorts;i++) { CLAM::OutPortBase & port = _proc->GetOutPort(i); CLAM::AudioOutPort & audioPort = dynamic_cast<CLAM::AudioOutPort&>(port); @@ -202,7 +202,7 @@ _proc->Do(); - for(int i=0; i<_nOutControls; i++) + for(unsigned i=0; i<_nOutControls; i++) memcpy(_outcontrolBuffers[i], dataList[i], nSamples*sizeof(CLAM::TData) ); } Index: CLAM/src/Processing/Analysis/Tonal/FourierTransform.cxx =================================================================== --- CLAM/src/Processing/Analysis/Tonal/FourierTransform.cxx (revision 15134) +++ CLAM/src/Processing/Analysis/Tonal/FourierTransform.cxx (working copy) @@ -132,12 +132,12 @@ _realInput[i] = input[i]; } fftw_execute(_plan); - for (int i=0; i<mFrameSize; i+=2) + for (unsigned long i=0; i<mFrameSize; i+=2) { spectrum[i] = complexOutput[i/2][0]; spectrum[i+1] = - complexOutput[i/2][1]; } - for (int i=1; i<mFrameSize; i+=2) + for (unsigned long i=1; i<mFrameSize; i+=2) { unsigned j = mFrameSize*2-i; spectrum[j] = complexOutput[i/2][0]; Index: CLAM/src/Processing/ArithOps/SpectrumProduct.cxx =================================================================== --- CLAM/src/Processing/ArithOps/SpectrumProduct.cxx (revision 15134) +++ CLAM/src/Processing/ArithOps/SpectrumProduct.cxx (working copy) @@ -103,7 +103,7 @@ bool SpectrumProduct::Do() { const Spectrum& in1 = mInput1.GetData(); - const Spectrum& in2 = mInput2.GetData(); + const Spectrum& in2 = mInput2.GetData(); // Why do variables which are used only by CLAM_DEBUG_ASSERT() generate a compiler warning (unused variable)? Spectrum& out = mOutput.GetData(); if (in1.HasComplexArray()) Index: CLAM/src/Processing/ArithOps/AudioBufferMixer.cxx =================================================================== --- CLAM/src/Processing/ArithOps/AudioBufferMixer.cxx (revision 15134) +++ CLAM/src/Processing/ArithOps/AudioBufferMixer.cxx (working copy) @@ -46,7 +46,8 @@ void AudioBufferMixer::CreatePortsAndControls() { - unsigned portSize = BackendBufferSize(); + //unsigned portSize = BackendBufferSize(); + // is portSize intended to limit the number of ports which can be created? for( int i=0; i<mConfig.GetNumberOfInPorts(); i++ ) { @@ -56,7 +57,6 @@ inPort->SetSize( 1 ); inPort->SetHop( 1 ); mInputPorts.push_back( inPort ); - mInputControls.push_back( new FloatInControl("Gain " + number.str(), this) ); } unsigned int inPortsNumber=mConfig.GetNumberOfInPorts(); @@ -65,10 +65,10 @@ if (useConfigGains) { gainsArray=mConfig.GetDefaultGains(); - unsigned numberofConfiguredGains=gainsArray.Size(); + int numberofConfiguredGains=gainsArray.Size(); gainsArray.Resize(inPortsNumber); gainsArray.SetSize(inPortsNumber); - for (unsigned i=numberofConfiguredGains;i<gainsArray.Size();i++) + for (int i=numberofConfiguredGains;i<gainsArray.Size();i++) { gainsArray[i]=1; } Index: CLAM/src/Processing/ArithOps/AudioMixer.cxx =================================================================== --- CLAM/src/Processing/ArithOps/AudioMixer.cxx (revision 15134) +++ CLAM/src/Processing/ArithOps/AudioMixer.cxx (working copy) @@ -67,7 +67,7 @@ unsigned numberofConfiguredGains=gainsArray.Size(); gainsArray.Resize(inPortsNumber); gainsArray.SetSize(inPortsNumber); - for (unsigned i=numberofConfiguredGains;i<gainsArray.Size();i++) + for (int i=numberofConfiguredGains;i<gainsArray.Size();i++) { gainsArray[i]=1; } Index: CLAM/src/Processing/Transformations/FDCombFilter.cxx =================================================================== --- CLAM/src/Processing/Transformations/FDCombFilter.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/FDCombFilter.cxx (working copy) @@ -77,7 +77,7 @@ TData twoPiOverPeriod = TWO_PI/period; TData oneOverTwo = 1./2.0; - for(unsigned i=0; i<sizeSpectrum; i++) + for(int i=0; i<sizeSpectrum; i++) { //todo: this loop is very inefficient because of the sin and cos but there are ways of optimizing //these kind of iterative sine computations Index: CLAM/src/Processing/Transformations/EnvelopeExtractor.cxx =================================================================== --- CLAM/src/Processing/Transformations/EnvelopeExtractor.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/EnvelopeExtractor.cxx (working copy) @@ -82,7 +82,7 @@ TData IntervalAmplitudeAverages::Acumulated(int ipoint) { TData res =0.0; - for (unsigned i=0; i< mNMemoryPoints; i++) + for (int i=0; i< mNMemoryPoints; i++) res += AcumulationShape(i) * Current(ipoint-i); return res; } Index: CLAM/src/Processing/Transformations/Spectral/Partializer.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/Partializer.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/Partializer.cxx (working copy) @@ -43,7 +43,7 @@ out = in; //TODO big cludge for streaming } DataArray& inMag = in.GetMagBuffer(); - DataArray& outMag = out.GetMagBuffer(); + // DataArray& outMag = out.GetMagBuffer(); // Unused variable int spectrumSize = in.GetSize(); mMag.Resize(spectrumSize); Index: CLAM/src/Processing/Transformations/Spectral/Peakalizer.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/Peakalizer.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/Peakalizer.cxx (working copy) @@ -43,7 +43,7 @@ out = in; //TODO big cludge for streaming } DataArray& inMag = in.GetMagBuffer(); - DataArray& outMag = out.GetMagBuffer(); + //DataArray& outMag = out.GetMagBuffer(); // unused variable int spectrumSize = in.GetSize(); mMag.Resize(spectrumSize); @@ -56,12 +56,12 @@ int bandwidth = Round(mBandWidthCtl.GetLastValue()* spectralResolution*0.5); int i,n; - //first we set everything to 0 (it could be done more efficiently) + //first we set everything to 0 (TODO: could be done more efficiently) for(i = 0; i<spectrumSize; i++) { mMag[i] = 0.; } - for(i = 0; i<spectrumSize; i++) + for(i = 0; i<spectrumSize; i++) //(TODO: could be done more efficiently) { if(inMag[i] > threshold) { Index: CLAM/src/Processing/Transformations/Spectral/3BandGate.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/3BandGate.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/3BandGate.cxx (working copy) @@ -29,8 +29,8 @@ { static const char * metadata[] = { "key", "ThreeBandGate", - // "category", "Spectral Transformations", - // "description", "ThreeBandGate", + "category", "Spectral Transformations", + "description", "ThreeBandGate", 0 }; static FactoryRegistrator<ProcessingFactory, ThreeBandGate> reg = metadata; @@ -49,7 +49,7 @@ TData spectralResolution = spectrumSize/in.GetSpectralRange(); int lowCutoff = Round(mLowCutoffFreqCtl.GetLastValue()* spectralResolution); - int highCutoff = Round(mHighCutoffFreqCtl.GetLastValue()* spectralResolution); + int highCutoff = Round(mHighCutoffFreqCtl.GetLastValue()* spectralResolution); //note: control is supposed to be sent as dB's TData lowThreshold = log2lin(mLowThresholdCtl.GetLastValue()); @@ -57,7 +57,6 @@ TData highThreshold = log2lin(mHighThresholdCtl.GetLastValue()); int i; - TData currentThreshold = lowThreshold; for( i = 0; i<lowCutoff; i++) { if(iMag[i]<lowThreshold) Index: CLAM/src/Processing/Transformations/Spectral/SpectralCombDelta.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/SpectralCombDelta.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/SpectralCombDelta.cxx (working copy) @@ -43,7 +43,7 @@ out = in; //TODO big cludge for streaming } DataArray& inMag = in.GetMagBuffer(); - DataArray& outMag = out.GetMagBuffer(); + //DataArray& outMag = out.GetMagBuffer(); // Unused variable int spectrumSize = in.GetSize(); mMag.Resize(spectrumSize); Index: CLAM/src/Processing/Transformations/Spectral/3BandCompressor.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/3BandCompressor.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/3BandCompressor.cxx (working copy) @@ -55,18 +55,18 @@ TData midThreshold = log2lin(mMidThresholdCtl.GetLastValue()); TData highThreshold = log2lin(mHighThresholdCtl.GetLastValue()); - TData currentThreshold = lowThreshold; - for(int i = 0; i<lowCutoff; i++) + int i; + for(i = 0; i<lowCutoff; i++) { if(iMag[i]>lowThreshold) oMag[i] = lowThreshold; } - for(int i = lowCutoff; i<highCutoff; i++) + for(i = lowCutoff; i<highCutoff; i++) { if(iMag[i]>midThreshold) oMag[i] = midThreshold; } - for(int i = highCutoff; i<spectrumSize; i++) + for(i = highCutoff; i<spectrumSize; i++) { if(iMag[i]>highThreshold) oMag[i] = highThreshold; Index: CLAM/src/Processing/Transformations/Spectral/SpectralNotch.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/SpectralNotch.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/SpectralNotch.cxx (working copy) @@ -29,8 +29,8 @@ { static const char * metadata[] = { "key", "SpectralNotch", - // "category", "Spectral Transformations", - // "description", "SpectralNotch", + "category", "Spectral Transformations", + "description", "SpectralNotch", 0 }; static FactoryRegistrator<ProcessingFactory, SpectralNotch> reg = metadata; @@ -49,7 +49,7 @@ int band = Round(mBandwidthCtl.GetLastValue()*spectralResolution); TData gain = log2lin(mGainCtl.GetLastValue()); int n; - int harmonic = 1; + // int harmonic = 1; // Unused variable. If someone were to implement a notch filter which removes harmonics, then they should either create a seperate processing or implement a contrl which turns harmonic filtering on/off. int leftLimit = centerFreq-band; if(leftLimit<0) leftLimit = 0; int rightLimit = centerFreq+band+1; Index: CLAM/src/Processing/Transformations/Spectral/Deesser.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/Deesser.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/Deesser.cxx (working copy) @@ -29,8 +29,8 @@ { static const char * metadata[] = { "key", "Deesser", - // "category", "Spectral Transformations", - // "description", "Deesser", + "category", "Spectral Transformations", + "description", "Deesser", 0 }; static FactoryRegistrator<ProcessingFactory, Deesser> reg = metadata; @@ -58,7 +58,7 @@ TData threshold = log2lin(mThresholdCtl.GetLastValue()); int i; - TData maxMag = 0; + //TData maxMag = 0; for( i = lowCutoff; i<highCutoff; i++) { if(iMag[i]>threshold) oMag[i] = threshold; Index: CLAM/src/Processing/Transformations/Spectral/Vocoder.cxx =================================================================== --- CLAM/src/Processing/Transformations/Spectral/Vocoder.cxx (revision 15134) +++ CLAM/src/Processing/Transformations/Spectral/Vocoder.cxx (working copy) @@ -44,7 +44,7 @@ int nBands = mNumBandsCtl.GetLastValue(); int nGainBands = 5; //it is one more than the actual gains - int firstBand = 5; + //int firstBand = 5; // unused variable TData fFirstBand = 100; DataArray gains(4); @@ -61,24 +61,24 @@ mMagBuffer.Resize(spectrumSize); mMagBuffer.SetSize(spectrumSize); - TData bandFactor = pow(TData(spectrumSize),1./nBands); + //TData bandFactor = pow(TData(spectrumSize),1./nBands); // unused variable TData fBandFactor = pow(TData(spectralRange),1./nBands); TData fCurrentBandLimit = fFirstBand; int currentBandLimit = Round(fFirstBand*spectralResolution); int lastBandLimit = 0; - TData fLastBandLimit = 0.; + //TData fLastBandLimit = 0.; // unused variable int freqShift = Round(mFreqShiftCtl.GetLastValue()*spectralResolution); int currentOscBin = int(spectrumSize/nBands) + freqShift; - TData fCurrentOsc = spectralRange/nBands; + //TData fCurrentOsc = spectralRange/nBands; // unused variable int currentGainIndex = 0; TData fCurrentGainBandLimit = fCurrentBandLimit*2; int currentGainBandLimit = Round(fCurrentGainBandLimit*spectralResolution); - TData gainBandFactor = pow(TData(spectrumSize/currentBandLimit),1./nGainBands); + //TData gainBandFactor = pow(TData(spectrumSize/currentBandLimit),1./nGainBands); // unused variable TData fGainBandFactor = pow(TData(spectralRange/fCurrentGainBandLimit),1./nGainBands); TData bandEnergy =0;
_______________________________________________ clam-devel mailing list clam-devel@lists.clam-project.org http://lists.clam-project.org/listinfo.cgi/clam-devel-clam-project.org