changeset 414:7e8d1f26b098

Fix compiler warnings with -Wall -Wextra
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 28 Sep 2015 12:33:17 +0100
parents ec7318974497
children 4ae4229a074a 7ead6122aef7
files build/linux/Makefile.linux64 dsp/chromagram/Chromagram.cpp dsp/chromagram/Chromagram.h dsp/rateconversion/DecimatorB.cpp dsp/segmentation/ClusterMeltSegmenter.cpp dsp/segmentation/Segmenter.cpp dsp/segmentation/cluster_melt.c dsp/signalconditioning/DFProcess.cpp dsp/tempotracking/TempoTrack.cpp dsp/tempotracking/TempoTrack.h dsp/tonal/TCSgram.cpp dsp/tonal/TonalEstimator.h dsp/wavelet/Wavelet.cpp hmm/hmm.c maths/CosineDistance.cpp maths/MathUtilities.cpp maths/MathUtilities.h maths/pca/pca.c tests/Makefile thread/Thread.cpp
diffstat 20 files changed, 125 insertions(+), 138 deletions(-) [+]
line wrap: on
line diff
--- a/build/linux/Makefile.linux64	Tue Sep 08 13:18:14 2015 +0100
+++ b/build/linux/Makefile.linux64	Mon Sep 28 12:33:17 2015 +0100
@@ -1,6 +1,7 @@
 
-CFLAGS := -DNDEBUG -O3 -fPIC -ffast-math -msse -msse2 -mfpmath=sse -ftree-vectorize -DUSE_PTHREADS -Ibuild/linux/amd64
-#CFLAGS := -DDEBUG -g -fPIC -ffast-math -DUSE_PTHREADS -Ibuild/linux/amd64
+#CFLAGS := -DNDEBUG -O3 -fPIC -ffast-math -msse -msse2 -mfpmath=sse -ftree-vectorize -DUSE_PTHREADS -Ibuild/linux/amd64
+CFLAGS := -DDEBUG -g -Wall -Wextra -Werror -fPIC -ffast-math -DUSE_PTHREADS -Ibuild/linux/amd64
+
 CXXFLAGS := $(CFLAGS)
 
 include build/general/Makefile.inc
--- a/dsp/chromagram/Chromagram.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/chromagram/Chromagram.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -34,7 +34,7 @@
     m_normalise = Config.normalise;     // if frame normalisation is required
 
     // No. of constant Q bins
-    m_uK = ( unsigned int ) ceil( m_BPO * log(m_FMax/m_FMin)/log(2.0));	
+    m_uK = (int) ceil( m_BPO * log(m_FMax/m_FMin)/log(2.0));	
 
     // Create array for chroma result
     m_chromadata = new double[ m_BPO ];
@@ -112,7 +112,7 @@
 
     MathUtilities::getFrameMinMax( src, m_BPO, & min, &max );
 
-    for( unsigned int i = 0; i < m_BPO; i++ )
+    for (int i = 0; i < m_BPO; i++)
     {
 	val = src[ i ] / max;
 
@@ -153,19 +153,17 @@
     }
 
     // initialise chromadata to 0
-    for (unsigned i = 0; i < m_BPO; i++) m_chromadata[i] = 0;
+    for (int i = 0; i < m_BPO; i++) m_chromadata[i] = 0;
 
-    double cmax = 0.0;
-    double cval = 0;
     // Calculate ConstantQ frame
     m_ConstantQ->process( real, imag, m_CQRe, m_CQIm );
 	
     // add each octave of cq data into Chromagram
-    const unsigned octaves = (int)floor(double( m_uK/m_BPO))-1;
-    for (unsigned octave = 0; octave <= octaves; octave++) 
+    const int octaves = (int)floor(double( m_uK/m_BPO))-1;
+    for (int octave = 0; octave <= octaves; octave++) 
     {
-	unsigned firstBin = octave*m_BPO;
-	for (unsigned i = 0; i < m_BPO; i++) 
+	int firstBin = octave*m_BPO;
+	for (int i = 0; i < m_BPO; i++) 
 	{
 	    m_chromadata[i] += kabs( m_CQRe[ firstBin + i ], m_CQIm[ firstBin + i ]);
 	}
--- a/dsp/chromagram/Chromagram.h	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/chromagram/Chromagram.h	Mon Sep 28 12:33:17 2015 +0100
@@ -21,10 +21,10 @@
 #include "ConstantQ.h"
 
 struct ChromaConfig{
-    unsigned int FS;
+    int FS;
     double min;
     double max;
-    unsigned int BPO;
+    int BPO;
     double CQThresh;
     MathUtilities::NormaliseType normalise;
 };
@@ -44,10 +44,10 @@
     double kabs( double real, double imag );
 	
     // Results
-    unsigned int getK() { return m_uK;}
-    unsigned int getFrameSize() { return m_frameSize; }
-    unsigned int getHopSize()   { return m_hopSize; }
-
+    int getK() { return m_uK;}
+    int getFrameSize() { return m_frameSize; }
+    int getHopSize()   { return m_hopSize; }
+    
 private:
     int initialise( ChromaConfig Config );
     int deInitialise();
@@ -58,13 +58,13 @@
     double* m_chromadata;
     double m_FMin;
     double m_FMax;
-    unsigned int m_BPO;
-    unsigned int m_uK;
+    int m_BPO;
+    int m_uK;
 
     MathUtilities::NormaliseType m_normalise;
 
-    unsigned int m_frameSize;
-    unsigned int m_hopSize;
+    int m_frameSize;
+    int m_hopSize;
 
     FFTReal* m_FFT;
     ConstantQ* m_ConstantQ;
--- a/dsp/rateconversion/DecimatorB.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/rateconversion/DecimatorB.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -112,7 +112,6 @@
 {
     int filteridx = 0;
     int factorDone = 1;
-    int factorRemaining = m_decFactor;
 
     while (factorDone < m_decFactor) {
 
--- a/dsp/segmentation/ClusterMeltSegmenter.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/segmentation/ClusterMeltSegmenter.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -329,23 +329,27 @@
     delete decimator;
     decimator = 0;
 
-    if (features.size() < histogramLength) return;
+    int sz = features.size();
+    
+    if (sz < histogramLength) return;
 /*    
     std::cerr << "ClusterMeltSegmenter::segment: have " << features.size()
               << " features with " << features[0].size() << " coefficients (ncoeff = " << ncoeff << ", ncomponents = " << ncomponents << ")" << std::endl;
 */
     // copy the features to a native array and use the existing C segmenter...
     double** arrFeatures = new double*[features.size()];	
-    for (int i = 0; i < features.size(); i++)
+    for (int i = 0; i < sz; i++)
     {
         if (featureType == FEATURE_TYPE_UNKNOWN) {
             arrFeatures[i] = new double[features[0].size()];
-            for (int j = 0; j < features[0].size(); j++)
-                arrFeatures[i][j] = features[i][j];	
+            for (int j = 0; j < int(features[0].size()); j++) {
+                arrFeatures[i][j] = features[i][j];
+            }
         } else {
             arrFeatures[i] = new double[ncoeff+1];	// allow space for the normalised envelope
-            for (int j = 0; j < ncoeff; j++)
-                arrFeatures[i][j] = features[i][j];	
+            for (int j = 0; j < ncoeff; j++) {
+                arrFeatures[i][j] = features[i][j];
+            }
         }
     }
 	
@@ -364,8 +368,7 @@
 	
     // de-allocate arrays
     delete [] q;
-    for (int i = 0; i < features.size(); i++)
-        delete [] arrFeatures[i];
+    for (int i = 0; i < int(features.size()); i++) delete [] arrFeatures[i];
     delete [] arrFeatures;
 	
     // clear the features
--- a/dsp/segmentation/Segmenter.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/segmentation/Segmenter.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -18,14 +18,13 @@
 
 ostream& operator<<(ostream& os, const Segmentation& s)
 {
-	os << "structure_name : begin_time end_time\n";
+    os << "structure_name : begin_time end_time\n";
 	
-	for (int i = 0; i < s.segments.size(); i++)
-	{
-		Segment seg = s.segments[i];
-		os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) 
-			<< '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
-	}
-	
-	return os;
+    for (int i = 0; i < int(s.segments.size()); i++) {
+	Segment seg = s.segments[i];
+	os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) 
+	   << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
+    }
+    
+    return os;
 }
--- a/dsp/segmentation/cluster_melt.c	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/segmentation/cluster_melt.c	Mon Sep 28 12:33:17 2015 +0100
@@ -43,7 +43,7 @@
 
 void cluster_melt(double *h, int m, int n, double *Bsched, int t, int k, int l, int *c) {
 	double lambda, sum, beta, logsumexp, maxlp;
-	int i, j, a, b, b0, b1, limit, B, it, maxiter, maxiter0, maxiter1;
+	int i, j, a, b, b0, b1, limit, /* B, */ it, maxiter, maxiter0, maxiter1;
 	double** cl;	/* reference histograms for each cluster */
 	int** nc;	/* neighbour counts for each histogram */
 	double** lp;	/* soft assignment probs for each histogram */
@@ -57,7 +57,7 @@
 		limit = l;
 	else
 		limit = DEFAULT_LIMIT;		/* use default if no valid neighbourhood limit supplied */
-	B = 2 * limit + 1;
+//	B = 2 * limit + 1;
 	maxiter0 = 20;	/* number of iterations at initial temperature */
 	maxiter1 = 5;	/* number of iterations at subsequent temperatures */
 	
--- a/dsp/signalconditioning/DFProcess.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/signalconditioning/DFProcess.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -193,7 +193,7 @@
 
     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; 
     }
--- a/dsp/tempotracking/TempoTrack.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/tempotracking/TempoTrack.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -70,10 +70,6 @@
     m_tempoScratch = new double[ m_lagLength ];
 	m_smoothRCF = new double[ m_lagLength ];
 
-
-    unsigned int winPre = Params.WinT.pre;
-    unsigned int winPost = Params.WinT.post;
-
     m_DFFramer.configure( m_winLength, m_lagLength );
 	
     m_DFPParams.length = m_winLength;
@@ -120,9 +116,9 @@
 
 }
 
-void TempoTrack::createCombFilter(double* Filter, unsigned int winLength, unsigned int TSig, double beatLag)
+void TempoTrack::createCombFilter(double* Filter, int winLength, int /* TSig */, double beatLag)
 {
-    unsigned int i;
+    int i;
 
     if( beatLag == 0 )
     {
@@ -147,15 +143,15 @@
 
     double period = 0;
     double maxValRCF = 0.0;
-    unsigned int maxIndexRCF = 0;
+    int maxIndexRCF = 0;
 
     double* pdPeaks;
 
-    unsigned int maxIndexTemp;
-    double	maxValTemp;
-    unsigned int count; 
+    int maxIndexTemp;
+    double maxValTemp;
+    int count; 
 	
-    unsigned int numelem,i,j;
+    int numelem,i,j;
     int a, b;
 
     for( i = 0; i < m_lagLength; i++ )
@@ -476,7 +472,7 @@
     }
 }
 
-int TempoTrack::findMeter(double *ACF, unsigned int len, double period)
+int TempoTrack::findMeter(double *ACF, int len, double period)
 {
     int i;
     int p = (int)MathUtilities::round( period );
@@ -491,7 +487,7 @@
     double temp4B = 0.0;
 
     double* dbf = new double[ len ]; int t = 0;
-    for( unsigned int u = 0; u < len; u++ ){ dbf[ u ] = 0.0; }
+    for( int u = 0; u < len; u++ ){ dbf[ u ] = 0.0; }
 
     if( (double)len < 6 * p + 2 )
     {
@@ -548,7 +544,7 @@
     return tsig;
 }
 
-void TempoTrack::createPhaseExtractor(double *Filter, unsigned int winLength, double period, unsigned int fsp, unsigned int lastBeat)
+void TempoTrack::createPhaseExtractor(double *Filter, int /* winLength */, double period, int fsp, int lastBeat)
 {	
     int p = (int)MathUtilities::round( period );
     int predictedOffset = 0;
@@ -584,7 +580,7 @@
 	double sigma = (double)p/8;
 	double PhaseMin = 0.0;
 	double PhaseMax = 0.0;
-	unsigned int scratchLength = p*2;
+	int scratchLength = p*2;
 	double temp = 0.0;
 
 	for(  int i = 0; i < scratchLength; i++ )
@@ -604,7 +600,7 @@
         std::cerr << "predictedOffset = " << predictedOffset << std::endl;
 #endif
 
-	unsigned int index = 0;
+	int index = 0;
 	for (int i = p - ( predictedOffset - 1); i < p + ( p - predictedOffset) + 1; i++)
 	{
 #ifdef DEBUG_TEMPO_TRACK
@@ -624,7 +620,7 @@
     delete [] phaseScratch;
 }
 
-int TempoTrack::phaseMM(double *DF, double *weighting, unsigned int winLength, double period)
+int TempoTrack::phaseMM(double *DF, double *weighting, int winLength, double period)
 {
     int alignment = 0;
     int p = (int)MathUtilities::round( period );
@@ -667,7 +663,7 @@
     return alignment;
 }
 
-int TempoTrack::beatPredict(unsigned int FSP0, double alignment, double period, unsigned int step )
+int TempoTrack::beatPredict(int FSP0, double alignment, double period, int step )
 {
     int beat = 0;
 
@@ -712,39 +708,39 @@
     causalDF = DF;
 
     //Prepare Causal Extension DFData
-    unsigned int DFCLength = m_dataLength + m_winLength;
+//    int DFCLength = m_dataLength + m_winLength;
 	
-    for( unsigned int j = 0; j < m_winLength; j++ )
+    for( int j = 0; j < m_winLength; j++ )
     {
 	causalDF.push_back( 0 );
     }
 	
 	
     double* RW = new double[ m_lagLength ];
-    for( unsigned int clear = 0; clear < m_lagLength; clear++){ RW[ clear ] = 0.0;}
+    for (int clear = 0; clear < m_lagLength; clear++){ RW[ clear ] = 0.0;}
 
     double* GW = new double[ m_lagLength ];
-    for(unsigned int clear = 0; clear < m_lagLength; clear++){ GW[ clear ] = 0.0;}
+    for (int clear = 0; clear < m_lagLength; clear++){ GW[ clear ] = 0.0;}
 
     double* PW = new double[ m_lagLength ];
-    for(unsigned clear = 0; clear < m_lagLength; clear++){ PW[ clear ] = 0.0;}
+    for(int clear = 0; clear < m_lagLength; clear++){ PW[ clear ] = 0.0;}
 
     m_DFFramer.setSource( &causalDF[0], m_dataLength );
 
-    unsigned int TTFrames = m_DFFramer.getMaxNoFrames();
+    int TTFrames = m_DFFramer.getMaxNoFrames();
 
 #ifdef DEBUG_TEMPO_TRACK
     std::cerr << "TTFrames = " << TTFrames << std::endl;
 #endif
 	
     double* periodP = new double[ TTFrames ];
-    for(unsigned clear = 0; clear < TTFrames; clear++){ periodP[ clear ] = 0.0;}
+    for(int clear = 0; clear < TTFrames; clear++){ periodP[ clear ] = 0.0;}
 	
     double* periodG = new double[ TTFrames ];
-    for(unsigned clear = 0; clear < TTFrames; clear++){ periodG[ clear ] = 0.0;}
+    for(int clear = 0; clear < TTFrames; clear++){ periodG[ clear ] = 0.0;}
 	
     double* alignment = new double[ TTFrames ];
-    for(unsigned clear = 0; clear < TTFrames; clear++){ alignment[ clear ] = 0.0;}
+    for(int clear = 0; clear < TTFrames; clear++){ alignment[ clear ] = 0.0;}
 
     m_beats.clear();
 
@@ -752,7 +748,7 @@
 
     int TTLoopIndex = 0;
 
-    for( unsigned int i = 0; i < TTFrames; i++ )
+    for( int i = 0; i < TTFrames; i++ )
     {
 	m_DFFramer.getFrame( m_rawDFFrame );
 
--- a/dsp/tempotracking/TempoTrack.h	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/tempotracking/TempoTrack.h	Mon Sep 28 12:33:17 2015 +0100
@@ -30,16 +30,16 @@
 
 struct WinThresh
 {
-    unsigned int pre;
-    unsigned int post;
+    int pre;
+    int post;
 };
 
 struct TTParams
 {
-    unsigned int winLength; //Analysis window length
-    unsigned int lagLength; //Lag & Stride size
-    unsigned int alpha; //alpha-norm parameter
-    unsigned int LPOrd; // low-pass Filter order
+    int winLength; //Analysis window length
+    int lagLength; //Lag & Stride size
+    int alpha; //alpha-norm parameter
+    int LPOrd; // low-pass Filter order
     double* LPACoeffs; //low pass Filter den coefficients
     double* LPBCoeffs; //low pass Filter num coefficients
     WinThresh WinT;//window size in frames for adaptive thresholding [pre post]:
@@ -59,22 +59,22 @@
     void initialise( TTParams Params );
     void deInitialise();
 
-    int beatPredict( unsigned int FSP, double alignment, double period, unsigned int step);
-    int phaseMM( double* DF, double* weighting, unsigned int winLength, double period );
-    void createPhaseExtractor( double* Filter, unsigned int winLength,  double period,  unsigned int fsp, unsigned int lastBeat );
-    int findMeter( double* ACF,  unsigned int len, double period );
+    int beatPredict( int FSP, double alignment, double period, int step);
+    int phaseMM( double* DF, double* weighting, int winLength, double period );
+    void createPhaseExtractor( double* Filter, int winLength,  double period,  int fsp, int lastBeat );
+    int findMeter( double* ACF,  int len, double period );
     void constDetect( double* periodP, int currentIdx, int* flag );
     void stepDetect( double* periodP, double* periodG, int currentIdx, int* flag );
-    void createCombFilter( double* Filter, unsigned int winLength, unsigned int TSig, double beatLag );
+    void createCombFilter( double* Filter, int winLength, int TSig, double beatLag );
     double tempoMM( double* ACF, double* weight, int sig );
 	
-    unsigned int m_dataLength;
-    unsigned int m_winLength;
-    unsigned int m_lagLength;
+    int m_dataLength;
+    int m_winLength;
+    int m_lagLength;
 
-    double		 m_rayparam;
-    double		 m_sigma;
-    double		 m_DFWVNnorm;
+    double m_rayparam;
+    double m_sigma;
+    double m_DFWVNnorm;
 
     vector<int>	 m_beats; // Vector of detected beats
 
--- a/dsp/tonal/TCSgram.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/tonal/TCSgram.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -36,7 +36,7 @@
 {
 	if (iPosition < 0) 
 		rTCSVector = TCSVector();
-	else if (iPosition >= m_VectorList.size())
+	else if (iPosition >= int(m_VectorList.size()))
 		rTCSVector = TCSVector();
 	else
 		rTCSVector = m_VectorList[iPosition].second;
--- a/dsp/tonal/TonalEstimator.h	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/tonal/TonalEstimator.h	Mon Sep 28 12:33:17 2015 +0100
@@ -32,7 +32,7 @@
 	
 	void printDebug()
 	{
-		for (int i = 0; i < size(); i++)
+		for (int i = 0; i < int(size()); i++)
 		{
 			std::cout <<  (*this)[i] << ";";
 		}
@@ -68,7 +68,7 @@
 
 	void printDebug()
 	{
-		for (int i = 0; i < size(); i++)
+		for (int i = 0; i < int(size()); i++)
 		{
 			std::cout <<  (*this)[i] << ";";
 		}
--- a/dsp/wavelet/Wavelet.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/dsp/wavelet/Wavelet.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -1843,7 +1843,7 @@
         break;
     }
 
-    assert(flength == lpd.size());
-    assert(flength == hpd.size());
+    assert(flength == int(lpd.size()));
+    assert(flength == int(hpd.size()));
 }
 
--- a/hmm/hmm.c	Tue Sep 08 13:18:14 2015 +0100
+++ b/hmm/hmm.c	Mon Sep 28 12:33:17 2015 +0100
@@ -264,19 +264,6 @@
 	free(gauss_z);
 }
 
-void mlss_reestimate(double* p0, double** a, double** mu, double** cov, int N, int T, int L, int* q, double** x)
-{
-	/* fit a single Gaussian to observations in each state */
-	
-	/* calculate the mean observation in each state */
-	
-	/* calculate the overall covariance */
-	
-	/* count transitions */
-	
-	/* estimate initial probs from transitions (???) */
-}
-
 void baum_welch(double* p0, double** a, double** mu, double** cov, int N, int T, int L, double** x, double*** xi, double** gamma)
 {
 	int i, j, t;
@@ -749,7 +736,7 @@
 /* probability of multivariate Gaussian given mean, inverse and determinant of covariance */
 double gauss(double* x, int L, double* mu, double** icov, double detcov, double* y, double* z)
 {
-	int i, j;
+	int i;
 	double s = 0;
 	for (i = 0; i < L; i++)
 		y[i] = x[i] - mu[i];
@@ -770,7 +757,7 @@
 /* log probability of multivariate Gaussian given mean, inverse and determinant of covariance */
 double loggauss(double* x, int L, double* mu, double** icov, double detcov, double* y, double* z)
 {
-	int i, j;
+	int i;
 	double s = 0;
 	double ret;
 	for (i = 0; i < L; i++)
--- a/maths/CosineDistance.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/maths/CosineDistance.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -34,7 +34,7 @@
     }
     else
     {
-        for(int i=0; i<v1.size(); i++)
+        for(int i=0; i<int(v1.size()); i++)
         {
             dSum1 += v1[i]*v2[i];
             dDen1 += v1[i]*v1[i];
--- a/maths/MathUtilities.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/maths/MathUtilities.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -38,9 +38,9 @@
     return ValOut;
 }
 
-void MathUtilities::getAlphaNorm(const double *data, unsigned int len, unsigned int alpha, double* ANorm)
+void MathUtilities::getAlphaNorm(const double *data, int len, int alpha, double* ANorm)
 {
-    unsigned int i;
+    int i;
     double temp = 0.0;
     double a=0.0;
 	
@@ -56,10 +56,10 @@
     *ANorm = a;
 }
 
-double MathUtilities::getAlphaNorm( const std::vector <double> &data, unsigned int alpha )
+double MathUtilities::getAlphaNorm( const std::vector <double> &data, int alpha )
 {
-    unsigned int i;
-    unsigned int len = data.size();
+    int i;
+    int len = data.size();
     double temp = 0.0;
     double a=0.0;
 	
@@ -84,7 +84,7 @@
     }
 }
 
-double MathUtilities::median(const double *src, unsigned int len)
+double MathUtilities::median(const double *src, int len)
 {
     if (len == 0) return 0;
     
@@ -100,9 +100,9 @@
     }
 }
 
-double MathUtilities::sum(const double *src, unsigned int len)
+double MathUtilities::sum(const double *src, int len)
 {
-    unsigned int i ;
+    int i ;
     double retVal =0.0;
 
     for(  i = 0; i < len; i++)
@@ -113,7 +113,7 @@
     return retVal;
 }
 
-double MathUtilities::mean(const double *src, unsigned int len)
+double MathUtilities::mean(const double *src, int len)
 {
     double retVal =0.0;
 
@@ -127,8 +127,8 @@
 }
 
 double MathUtilities::mean(const std::vector<double> &src,
-                           unsigned int start,
-                           unsigned int count)
+                           int start,
+                           int count)
 {
     double sum = 0.;
 	
@@ -142,9 +142,9 @@
     return sum / count;
 }
 
-void MathUtilities::getFrameMinMax(const double *data, unsigned int len, double *min, double *max)
+void MathUtilities::getFrameMinMax(const double *data, int len, double *min, double *max)
 {
-    unsigned int i;
+    int i;
     double temp = 0.0;
 
     if (len == 0) {
@@ -171,10 +171,10 @@
     }
 }
 
-int MathUtilities::getMax( double* pData, unsigned int Length, double* pMax )
+int MathUtilities::getMax( double* pData, int Length, double* pMax )
 {
-	unsigned int index = 0;
-	unsigned int i;
+	int index = 0;
+	int i;
 	double temp = 0.0;
 	
 	double max = pData[0];
@@ -199,13 +199,13 @@
 
 int MathUtilities::getMax( const std::vector<double> & data, double* pMax )
 {
-	unsigned int index = 0;
-	unsigned int i;
+	int index = 0;
+	int i;
 	double temp = 0.0;
 	
 	double max = data[0];
 
-	for( i = 0; i < data.size(); i++)
+	for( i = 0; i < int(data.size()); i++)
 	{
 		temp = data[ i ];
 
--- a/maths/MathUtilities.h	Tue Sep 08 13:18:14 2015 +0100
+++ b/maths/MathUtilities.h	Mon Sep 28 12:33:17 2015 +0100
@@ -35,32 +35,32 @@
      * Return through min and max pointers the highest and lowest
      * values in the given array of the given length.
      */
-    static void	  getFrameMinMax( const double* data, unsigned int len,  double* min, double* max );
+    static void	  getFrameMinMax( const double* data, int len,  double* min, double* max );
 
     /**
      * Return the mean of the given array of the given length.
      */
-    static double mean( const double* src, unsigned int len );
+    static double mean( const double* src, int len );
 
     /**
      * Return the mean of the subset of the given vector identified by
      * start and count.
      */
     static double mean( const std::vector<double> &data,
-                        unsigned int start, unsigned int count );
+                        int start, int count );
     
     /**
      * Return the sum of the values in the given array of the given
      * length.
      */
-    static double sum( const double* src, unsigned int len );
+    static double sum( const double* src, int len );
 
     /**
      * Return the median of the values in the given array of the given
      * length. If the array is even in length, the returned value will
      * be half-way between the two values adjacent to median.
      */
-    static double median( const double* src, unsigned int len );
+    static double median( const double* src, int len );
 
     /**
      * The principle argument function. Map the phase angle ang into
@@ -73,12 +73,12 @@
      */
     static double mod( double x, double y);
 
-    static void	  getAlphaNorm(const double *data, unsigned int len, unsigned int alpha, double* ANorm);
-    static double getAlphaNorm(const std::vector <double> &data, unsigned int alpha );
+    static void	  getAlphaNorm(const double *data, int len, int alpha, double* ANorm);
+    static double getAlphaNorm(const std::vector <double> &data, int alpha );
 
     static void   circShift( double* data, int length, int shift);
 
-    static int	  getMax( double* data, unsigned int length, double* max = 0 );
+    static int	  getMax( double* data, int length, double* max = 0 );
     static int	  getMax( const std::vector<double> &data, double* max = 0 );
     static int    compareInt(const void * a, const void * b);
 
--- a/maths/pca/pca.c	Tue Sep 08 13:18:14 2015 +0100
+++ b/maths/pca/pca.c	Mon Sep 28 12:33:17 2015 +0100
@@ -252,7 +252,7 @@
 void pca_project(double** data, int n, int m, int ncomponents)
 {
 	int  i, j, k, k2;
-	double  **symmat, **symmat2, *evals, *interm;
+	double  **symmat, /* **symmat2, */ *evals, *interm;
 	
 	//TODO: assert ncomponents < m
 	
--- a/tests/Makefile	Tue Sep 08 13:18:14 2015 +0100
+++ b/tests/Makefile	Mon Sep 28 12:33:17 2015 +0100
@@ -1,6 +1,6 @@
 
 CFLAGS := -I.. $(CFLAGS)
-CXXFLAGS := -I.. -Wall -g $(CXXFLAGS)
+CXXFLAGS := -I.. -Wall -Wextra -g $(CXXFLAGS)
 
 LDFLAGS := $(LDFLAGS) -lboost_unit_test_framework -lpthread
 LIBS := ../libqm-dsp.a
--- a/thread/Thread.cpp	Tue Sep 08 13:18:14 2015 +0100
+++ b/thread/Thread.cpp	Mon Sep 28 12:33:17 2015 +0100
@@ -438,7 +438,11 @@
     }
 }
 
-Condition::Condition(string name) :
+Condition::Condition(string
+#ifdef DEBUG_CONDITION
+                     name
+#endif
+    ) :
     m_locked(false)
 #ifdef DEBUG_CONDITION
     , m_name(name)