# HG changeset patch # User Chris Cannam # Date 1409741261 -3600 # Node ID d7f6f60a8b3032ae5a6633dccf6cb7620804629d # Parent 856dbe997dcdefa109bc8243e5525803b5a1b12a Fix a couple of inadvertant integer divisions (from coverity scan) diff -r 856dbe997dcd -r d7f6f60a8b30 layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Wed Sep 03 11:44:40 2014 +0100 +++ b/layer/SpectrogramLayer.cpp Wed Sep 03 11:47:41 2014 +0100 @@ -1445,7 +1445,7 @@ if (!fft->isColumnAvailable(s)) continue; - float binfreq = (sr * q) / m_windowSize; + float binfreq = (float(sr) * q) / m_windowSize; if (q == q0i) freqMin = binfreq; if (q == q1i) freqMax = binfreq; @@ -2930,7 +2930,7 @@ // SVDEBUG << "SpectrogramLayer::setDisplayExtents: " << min << "->" << max << endl; if (min < 0) min = 0; - if (max > m_model->getSampleRate()/2) max = m_model->getSampleRate()/2; + if (max > m_model->getSampleRate()/2.f) max = m_model->getSampleRate()/2.f; int minf = lrintf(min); int maxf = lrintf(max);