Mercurial > hg > qm-dsp
changeset 325:31f22daeba64
Fix compiler warnings
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 13 Jun 2013 10:23:09 +0100 |
parents | 6332e4993f27 |
children | 891b8a8b652f |
files | dsp/onsets/DetectionFunction.cpp dsp/onsets/PeakPicking.cpp dsp/tempotracking/TempoTrackV2.cpp maths/MathUtilities.cpp maths/Polyfit.h |
diffstat | 5 files changed, 14 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/dsp/onsets/DetectionFunction.cpp Tue Feb 12 17:46:47 2013 +0000 +++ b/dsp/onsets/DetectionFunction.cpp Thu Jun 13 10:23:09 2013 +0100 @@ -102,10 +102,10 @@ int actualLength = MathUtilities::previousPowerOfTwo(m_dataLength); - if (actualLength != m_dataLength) { + if (actualLength != (int)m_dataLength) { // Pre-fill mag and phase vectors with zero, as the FFT output // will not fill the arrays - for (int i = actualLength/2; i < m_dataLength/2; ++i) { + for (int i = actualLength/2; i < (int)m_dataLength/2; ++i) { m_magnitude[i] = 0; m_thetaAngle[0] = 0; }
--- a/dsp/onsets/PeakPicking.cpp Tue Feb 12 17:46:47 2013 +0000 +++ b/dsp/onsets/PeakPicking.cpp Thu Jun 13 10:23:09 2013 +0100 @@ -89,7 +89,7 @@ quadEval( m_maxima, onsets ); - for( int b = 0; b < m_maxima.size(); b++) + for( int b = 0; b < (int)m_maxima.size(); b++) { src[ b ] = m_maxima[ b ]; } @@ -106,7 +106,7 @@ vector <double> m_poly; vector <double> m_err; - double p; +// double p; m_poly.push_back(0); m_poly.push_back(0); @@ -137,13 +137,13 @@ m_maxFit.push_back(selMax); } - p = TPolyFit::PolyFit2( m_err, m_maxFit, m_poly); +// p = TPolyFit::PolyFit2( m_err, m_maxFit, m_poly); double f = m_poly[0]; - double g = m_poly[1]; +// double g = m_poly[1]; double h = m_poly[2]; - int kk = m_poly.size(); +// int kk = m_poly.size(); if (h < -Qfilta || f > Qfiltc) {
--- a/dsp/tempotracking/TempoTrackV2.cpp Tue Feb 12 17:46:47 2013 +0000 +++ b/dsp/tempotracking/TempoTrackV2.cpp Thu Jun 13 10:23:09 2013 +0100 @@ -462,7 +462,7 @@ int startpoint = get_max_ind(tmp_vec) + cumscore.size() - beat_period[beat_period.size()-1] ; // can happen if no results obtained earlier (e.g. input too short) - if (startpoint >= backlink.size()) startpoint = backlink.size()-1; + if (startpoint >= (int)backlink.size()) startpoint = backlink.size()-1; // USE BACKLINK TO GET EACH NEW BEAT (TOWARDS THE BEGINNING OF THE FILE) // BACKTRACKING FROM THE END TO THE BEGINNING.. MAKING SURE NOT TO GO BEFORE SAMPLE 0
--- a/maths/MathUtilities.cpp Tue Feb 12 17:46:47 2013 +0000 +++ b/maths/MathUtilities.cpp Thu Jun 13 10:23:09 2013 +0100 @@ -155,7 +155,7 @@ { double sum = 0.; - for (int i = 0; i < count; ++i) + for (int i = 0; i < (int)count; ++i) { sum += src[start + i]; } @@ -167,7 +167,6 @@ { unsigned int i; double temp = 0.0; - double a=0.0; if (len == 0) { *min = *max = 0; @@ -317,9 +316,9 @@ case NormaliseUnitSum: { double sum = 0.0; - for (int i = 0; i < data.size(); ++i) sum += data[i]; + for (int i = 0; i < (int)data.size(); ++i) sum += data[i]; if (sum != 0.0) { - for (int i = 0; i < data.size(); ++i) data[i] /= sum; + for (int i = 0; i < (int)data.size(); ++i) data[i] /= sum; } } break; @@ -327,11 +326,11 @@ case NormaliseUnitMax: { double max = 0.0; - for (int i = 0; i < data.size(); ++i) { + for (int i = 0; i < (int)data.size(); ++i) { if (fabs(data[i]) > max) max = fabs(data[i]); } if (max != 0.0) { - for (int i = 0; i < data.size(); ++i) data[i] /= max; + for (int i = 0; i < (int)data.size(); ++i) data[i] /= max; } } break;
--- a/maths/Polyfit.h Tue Feb 12 17:46:47 2013 +0000 +++ b/maths/Polyfit.h Thu Jun 13 10:23:09 2013 +0100 @@ -124,7 +124,7 @@ std::cerr << "ERROR: PolyFit called with less than two points" << std::endl; return 0; } - if(npoints != y.size()) { + if(npoints != (int)y.size()) { std::cerr << "ERROR: PolyFit called with x and y of unequal size" << std::endl; return 0; }