From 0938a42440cc82ce8d0cb064840c258c863714ab Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 30 Sep 2011 17:55:14 +0000 Subject: fixes for 98% of all the warnings/errors reported by OS X gcc on tiger git-svn-id: svn://localhost/ardour2/branches/3.0@10179 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/qm-dsp/dsp/onsets/DetectionFunction.cpp | 4 ++-- libs/qm-dsp/dsp/onsets/PeakPicking.cpp | 5 +---- libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp | 2 +- libs/qm-dsp/dsp/wavelet/Wavelet.cpp | 2 +- libs/qm-dsp/maths/CosineDistance.cpp | 2 +- libs/qm-dsp/maths/MathUtilities.cpp | 11 +++++------ libs/qm-dsp/maths/Polyfit.h | 9 +++++---- 7 files changed, 16 insertions(+), 19 deletions(-) (limited to 'libs/qm-dsp') diff --git a/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp b/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp index 6ba1ad06ca..1abed021f9 100644 --- a/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp +++ b/libs/qm-dsp/dsp/onsets/DetectionFunction.cpp @@ -100,12 +100,12 @@ double DetectionFunction::process( const double *TDomain ) // data directly), we will have to use the next smallest power of // two from the block size. Results may vary accordingly! - int actualLength = MathUtilities::previousPowerOfTwo(m_dataLength); + unsigned int actualLength = MathUtilities::previousPowerOfTwo(m_dataLength); if (actualLength != 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 (unsigned int i = actualLength/2; i < m_dataLength/2; ++i) { m_magnitude[i] = 0; m_thetaAngle[0] = 0; } diff --git a/libs/qm-dsp/dsp/onsets/PeakPicking.cpp b/libs/qm-dsp/dsp/onsets/PeakPicking.cpp index 879ae8813c..55f56b46d0 100644 --- a/libs/qm-dsp/dsp/onsets/PeakPicking.cpp +++ b/libs/qm-dsp/dsp/onsets/PeakPicking.cpp @@ -80,7 +80,7 @@ void PeakPicking::process( double* src, unsigned int len, vector &onsets ) quadEval( m_maxima, onsets ); - for( int b = 0; b < m_maxima.size(); b++) + for(unsigned int b = 0; b < m_maxima.size(); b++) { src[ b ] = m_maxima[ b ]; } @@ -131,11 +131,8 @@ int PeakPicking::quadEval( vector &src, vector &idx ) p = TPolyFit::PolyFit2( m_err, m_maxFit, m_poly); double f = m_poly[0]; - double g = m_poly[1]; double h = m_poly[2]; - int kk = m_poly.size(); - if (h < -Qfilta || f > Qfiltc) { idx.push_back(m_maxIndex[j]); diff --git a/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp b/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp index bbe308b985..15c6d3ce36 100644 --- a/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp +++ b/libs/qm-dsp/dsp/signalconditioning/DFProcess.cpp @@ -180,7 +180,7 @@ void DFProcess::removeDCNormalize( double *src, double*dst ) MathUtilities::getAlphaNorm( src, m_length, m_alphaNormParam, &DFAlphaNorm ); - for( unsigned int i = 0; i< m_length; i++) + for(int i = 0; i< m_length; i++) { dst[ i ] = ( src[ i ] - DFMin ) / DFAlphaNorm; } diff --git a/libs/qm-dsp/dsp/wavelet/Wavelet.cpp b/libs/qm-dsp/dsp/wavelet/Wavelet.cpp index 764c84b24a..504090528c 100644 --- a/libs/qm-dsp/dsp/wavelet/Wavelet.cpp +++ b/libs/qm-dsp/dsp/wavelet/Wavelet.cpp @@ -77,7 +77,7 @@ Wavelet::createDecompositionFilters(Type wavelet, lpd.clear(); hpd.clear(); - int flength = 0; + unsigned int flength = 0; switch (wavelet) { diff --git a/libs/qm-dsp/maths/CosineDistance.cpp b/libs/qm-dsp/maths/CosineDistance.cpp index 13ab9ce0e8..fd2aeef3fe 100644 --- a/libs/qm-dsp/maths/CosineDistance.cpp +++ b/libs/qm-dsp/maths/CosineDistance.cpp @@ -34,7 +34,7 @@ double CosineDistance::distance(const vector &v1, } else { - for(int i=0; i &src, { double sum = 0.; - for (int i = 0; i < count; ++i) + for (unsigned int i = 0; i < count; ++i) { sum += src[start + i]; } @@ -167,7 +167,6 @@ void MathUtilities::getFrameMinMax(const double *data, unsigned int len, double { unsigned int i; double temp = 0.0; - double a=0.0; if (len == 0) { *min = *max = 0; @@ -317,9 +316,9 @@ void MathUtilities::normalise(std::vector &data, NormaliseType type) case NormaliseUnitSum: { double sum = 0.0; - for (int i = 0; i < data.size(); ++i) sum += data[i]; + for (unsigned int i = 0; i < data.size(); ++i) sum += data[i]; if (sum != 0.0) { - for (int i = 0; i < data.size(); ++i) data[i] /= sum; + for (unsigned int i = 0; i < data.size(); ++i) data[i] /= sum; } } break; @@ -327,11 +326,11 @@ void MathUtilities::normalise(std::vector &data, NormaliseType type) case NormaliseUnitMax: { double max = 0.0; - for (int i = 0; i < data.size(); ++i) { + for (unsigned int i = 0; i < 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 (unsigned int i = 0; i < data.size(); ++i) data[i] /= max; } } break; diff --git a/libs/qm-dsp/maths/Polyfit.h b/libs/qm-dsp/maths/Polyfit.h index 86bb64cb1e..3fac62d1b2 100644 --- a/libs/qm-dsp/maths/Polyfit.h +++ b/libs/qm-dsp/maths/Polyfit.h @@ -105,13 +105,13 @@ double TPolyFit::PolyFit2 (const vector &x, // nterms = coefs.size() // npoints = x.size() { - int i, j; + unsigned int i, j; double xi, yi, yc, srs, sum_y, sum_y2; Matrix xmatr; // Data matrix Matrix a; vector g; // Constant vector - const int npoints(x.size()); - const int nterms(coefs.size()); + const unsigned int npoints(x.size()); + const unsigned int nterms(coefs.size()); double correl_coef; zeroise(g, nterms); zeroise(a, nterms, nterms); @@ -278,7 +278,8 @@ bool TPolyFit::GaussJordan2(Matrix &b, double big, t; double pivot; double determ; - int irow, icol; + int irow = 0; + int icol = 0; int ncol(b.size()); int nv = 1; // single constant vector for(int i = 0; i < ncol; ++i) -- cgit v1.2.3