# HG changeset patch # User Chris Cannam # Date 1144344253 0 # Node ID e9b8b51f63266e32bb5d9286dd3212c1eb6700ce # Parent 9bbc57e8bf4390f5146f73bbc4b1fbd3d2fa0f87 * fix compile warnings and genuine int/size_t overflow diff -r 9bbc57e8bf43 -r e9b8b51f6326 plugin/FeatureExtractionPluginFactory.cpp --- a/plugin/FeatureExtractionPluginFactory.cpp Thu Apr 06 15:12:53 2006 +0000 +++ b/plugin/FeatureExtractionPluginFactory.cpp Thu Apr 06 17:24:13 2006 +0000 @@ -267,6 +267,9 @@ std::cerr << "WARNING: FeatureExtractionPluginFactory::instantiatePlugin: Failed to unload library " << soname.toStdString() << std::endl; } } + +// std::cerr << "FeatureExtractionPluginFactory::instantiatePlugin: Instantiated plugin " << label.toStdString() << " from library " << soname.toStdString() << ": descriptor " << descriptor << ", rv "<< rv << ", label " << rv->getName() << ", outputs " << rv->getOutputDescriptors().size() << std::endl; + return rv; } diff -r 9bbc57e8bf43 -r e9b8b51f6326 transform/FeatureExtractionPluginTransform.cpp --- a/transform/FeatureExtractionPluginTransform.cpp Thu Apr 06 15:12:53 2006 +0000 +++ b/transform/FeatureExtractionPluginTransform.cpp Thu Apr 06 17:24:13 2006 +0000 @@ -129,7 +129,7 @@ break; case Vamp::Plugin::OutputDescriptor::FixedSampleRate: - modelRate = m_descriptor->sampleRate; + modelRate = size_t(m_descriptor->sampleRate + 0.001); break; } @@ -242,7 +242,7 @@ while (1) { if (fftPlan) { - if (blockFrame - m_blockSize/2 > endFrame) break; + if (blockFrame - int(m_blockSize)/2 > endFrame) break; } else { if (blockFrame >= endFrame) break; } @@ -256,7 +256,7 @@ // channelCount is either m_input->channelCount or 1 - for (int ch = 0; ch < channelCount; ++ch) { + for (size_t ch = 0; ch < channelCount; ++ch) { if (fftPlan) { getFrames(ch, channelCount, blockFrame - m_blockSize/2, m_blockSize, buffers[ch]); @@ -267,18 +267,18 @@ } if (fftPlan) { - for (int ch = 0; ch < channelCount; ++ch) { - for (int i = 0; i < m_blockSize; ++i) { + for (size_t ch = 0; ch < channelCount; ++ch) { + for (size_t i = 0; i < m_blockSize; ++i) { fftInput[i] = buffers[ch][i]; } windower.cut(fftInput); - for (int i = 0; i < m_blockSize/2; ++i) { + for (size_t i = 0; i < m_blockSize/2; ++i) { double temp = fftInput[i]; fftInput[i] = fftInput[i + m_blockSize/2]; fftInput[i + m_blockSize/2] = temp; } fftw_execute(fftPlan); - for (int i = 0; i < m_blockSize/2; ++i) { + for (size_t i = 0; i < m_blockSize/2; ++i) { buffers[ch][i*2] = fftOutput[i][0]; buffers[ch][i*2 + 1] = fftOutput[i][1]; } @@ -336,7 +336,7 @@ startFrame = 0; } - size_t got = getInput()->getValues + long got = getInput()->getValues ((channelCount == 1 ? m_channel : channel), startFrame, startFrame + size, buffer + offset);