Index: src/mathutils.c
===================================================================
--- src/mathutils.c	(revision 0dbdb401e562c7e0359415653ec1d5276daa7787)
+++ src/mathutils.c	(revision f72ceebbdb0c649e8dd8e8dc95f066aed5746cd4)
@@ -30,5 +30,5 @@
     case aubio_win_rectangle:
       for (i=0;i<size;i++)
-        w[i] = 0.5; 
+        w[i] = 0.5;
       break;
     case aubio_win_hamming:
@@ -48,9 +48,9 @@
         w[i] = 0.42
           - 0.50 * COS(    TWO_PI*i/(size-1.0))
-          +	0.08 * COS(2.0*TWO_PI*i/(size-1.0));
+          + 0.08 * COS(2.0*TWO_PI*i/(size-1.0));
       break;
     case aubio_win_blackman_harris:
       for (i=0;i<size;i++)
-        w[i] = 0.35875 
+        w[i] = 0.35875
           - 0.48829 * COS(    TWO_PI*i/(size-1.0))
           + 0.14128 * COS(2.0*TWO_PI*i/(size-1.0))
@@ -74,5 +74,4 @@
 }
 
-
 smpl_t aubio_unwrap2pi(smpl_t phase) {
   /* mod(phase+pi,-2pi)+pi */
@@ -80,7 +79,5 @@
 }
 
-
-smpl_t vec_mean(fvec_t *s) 
-{
+smpl_t vec_mean(fvec_t *s) {
   uint_t i,j;
   smpl_t tmp = 0.0f;
@@ -91,7 +88,5 @@
 }
 
-
-smpl_t vec_sum(fvec_t *s) 
-{
+smpl_t vec_sum(fvec_t *s) {
   uint_t i,j;
   smpl_t tmp = 0.0f;
@@ -102,7 +97,5 @@
 }
 
-
-smpl_t vec_max(fvec_t *s) 
-{
+smpl_t vec_max(fvec_t *s) {
   uint_t i,j;
   smpl_t tmp = 0.0f;
@@ -113,6 +106,5 @@
 }
 
-smpl_t vec_min(fvec_t *s) 
-{
+smpl_t vec_min(fvec_t *s) {
   uint_t i,j;
   smpl_t tmp = s->data[0][0];
@@ -123,7 +115,5 @@
 }
 
-
-uint_t vec_min_elem(fvec_t *s) 
-{
+uint_t vec_min_elem(fvec_t *s) {
   uint_t i,j=0, pos=0.;
   smpl_t tmp = s->data[0][0];
@@ -136,6 +126,5 @@
 }
 
-uint_t vec_max_elem(fvec_t *s) 
-{
+uint_t vec_max_elem(fvec_t *s) {
   uint_t i,j=0, pos=0.;
   smpl_t tmp = 0.0f;
@@ -148,6 +137,5 @@
 }
 
-void vec_shift(fvec_t *s)
-{
+void vec_shift(fvec_t *s) {
   uint_t i,j;
   //smpl_t tmp = 0.0f;
@@ -161,6 +149,5 @@
 }
 
-smpl_t vec_local_energy(fvec_t * f)
-{
+smpl_t vec_local_energy(fvec_t * f) {
   smpl_t locE = 0.;
   uint_t i,j;
@@ -171,6 +158,5 @@
 }
 
-smpl_t vec_local_hfc(fvec_t * f)
-{
+smpl_t vec_local_hfc(fvec_t * f) {
   smpl_t locE = 0.;
   uint_t i,j;
@@ -181,6 +167,5 @@
 }
 
-smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha)
-{
+smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha) {
   smpl_t tmp = 0.;
   uint_t i,j;
@@ -191,7 +176,5 @@
 }
 
-
-void vec_dc_removal(fvec_t * mag)
-{
+void vec_dc_removal(fvec_t * mag) {
     smpl_t mini = 0.;
     uint_t length = mag->length, i=0, j;
@@ -202,7 +185,5 @@
 }
 
-
-void vec_alpha_normalise(fvec_t * mag, uint_t alpha)
-{
+void vec_alpha_normalise(fvec_t * mag, uint_t alpha) {
   smpl_t alphan = 1.;
   uint_t length = mag->length, i=0, j;
@@ -213,5 +194,4 @@
 }
 
-
 void vec_add(fvec_t * mag, smpl_t threshold) {
   uint_t length = mag->length, i=0, j;
@@ -221,8 +201,6 @@
 }
 
-
-void vec_adapt_thres(fvec_t * vec, fvec_t * tmp, 
-    uint_t post, uint_t pre) 
-{
+void vec_adapt_thres(fvec_t * vec, fvec_t * tmp,
+    uint_t post, uint_t pre) {
   uint_t length = vec->length, i=0, j;
   for (j=0;j<length;j++) {
@@ -232,6 +210,5 @@
 
 smpl_t vec_moving_thres(fvec_t * vec, fvec_t * tmpvec,
-    uint_t post, uint_t pre, uint_t pos) 
-{
+    uint_t post, uint_t pre, uint_t pos) {
   smpl_t * medar = (smpl_t *)tmpvec->data[0];
   uint_t k;
@@ -240,5 +217,5 @@
   /* post part of the buffer does not exist */
   if (pos<post+1) {
-    for (k=0;k<post+1-pos;k++) 
+    for (k=0;k<post+1-pos;k++)
       medar[k] = 0.; /* 0-padding at the beginning */
     for (k=post+1-pos;k<win_length;k++)
@@ -252,7 +229,7 @@
     for (k=0;k<length-pos+post+1;k++)
       medar[k] = vec->data[0][k+pos-post];
-    for (k=length-pos+post+1;k<win_length;k++) 
+    for (k=length-pos+post+1;k<win_length;k++)
       medar[k] = 0.; /* 0-padding at the end */
-  } 
+  }
   return vec_median(tmpvec);
 }
@@ -321,7 +298,7 @@
     for (frac = 0.; frac < 2.; frac = frac + step) {
       res = aubio_quadfrac(s0, s1, s2, frac);
-      if (res > resold) 
+      if (res > resold)
         resold = res;
-      else {				
+      else {
         exactpos += (frac-step)*2. - 1.;
         break;
@@ -345,5 +322,5 @@
       if (res < resold) {
         resold = res;
-      } else {				
+      } else {
         exactpos += (frac-step)*span - span/2.;
         break;
@@ -360,26 +337,26 @@
 
 uint_t vec_peakpick(fvec_t * onset, uint_t pos) {
-	uint_t i=0, tmp=0;
-	/*for (i=0;i<onset->channels;i++)*/
-		tmp = (onset->data[i][pos] > onset->data[i][pos-1]
-			&&  onset->data[i][pos] > onset->data[i][pos+1]
-			&&	onset->data[i][pos] > 0.);
-	return tmp;
+  uint_t i=0, tmp=0;
+  /*for (i=0;i<onset->channels;i++)*/
+  tmp = (onset->data[i][pos] > onset->data[i][pos-1]
+      &&  onset->data[i][pos] > onset->data[i][pos+1]
+      &&  onset->data[i][pos] > 0.);
+  return tmp;
 }
 
 smpl_t aubio_freqtomidi(smpl_t freq) {
-        /* log(freq/A-2)/log(2) */
-        smpl_t midi = freq/6.875;
-        midi = LOG(midi)/0.69314718055995;
-        midi *= 12;
-        midi -= 3;  
-        return midi;
+  /* log(freq/A-2)/log(2) */
+  smpl_t midi = freq/6.875;
+  midi = LOG(midi)/0.69314718055995;
+  midi *= 12;
+  midi -= 3;
+  return midi;
 }
 
 smpl_t aubio_miditofreq(smpl_t midi) {
-        smpl_t freq = (midi+3.)/12.;
-        freq = EXP(freq*0.69314718055995);
-        freq *= 6.875;
-        return freq;
+  smpl_t freq = (midi+3.)/12.;
+  freq = EXP(freq*0.69314718055995);
+  freq *= 6.875;
+  return freq;
 }
 
@@ -404,7 +381,5 @@
 }
 
-
-
-/** returns 1 if wassilence is 0 and RMS(ibuf)<threshold 
+/** returns 1 if wassilence is 0 and RMS(ibuf)<threshold
  * \bug mono
  */
@@ -436,7 +411,7 @@
 
   if (loudness < threshold)
-      return 1.;
+    return 1.;
   else
-      return loudness;
+    return loudness;
 }
 
@@ -451,5 +426,5 @@
       }
     //previous was positive
-    } else if ( input->data[i][j] <= 0. ){
+    } else if ( input->data[i][j] <= 0. ) {
       zcr += 1;
     }
@@ -471,25 +446,24 @@
 }
 
-void aubio_autocorr(fvec_t * input, fvec_t * output){
-        uint_t i = 0, j = 0, length = input->length;
-        smpl_t * data = input->data[0];
-        smpl_t * acf = output->data[0];
-        smpl_t tmp =0.;
-        for(i=0;i<length;i++){
-                for(j=i;j<length;j++){
-                        tmp += data[j-i]*data[j]; 
-                }
-                acf[i] = tmp /(smpl_t)(length-i);
-                tmp = 0.0;
-        }
-}
-
-void aubio_cleanup(void)
-{
+void aubio_autocorr(fvec_t * input, fvec_t * output) {
+  uint_t i = 0, j = 0, length = input->length;
+  smpl_t * data = input->data[0];
+  smpl_t * acf = output->data[0];
+  smpl_t tmp =0.;
+  for(i=0;i<length;i++){
+    for(j=i;j<length;j++){
+      tmp += data[j-i]*data[j];
+    }
+    acf[i] = tmp /(smpl_t)(length-i);
+    tmp = 0.0;
+  }
+}
+
+void aubio_cleanup(void) {
 #if FFTW3_SUPPORT
-        fftw_cleanup();
+  fftw_cleanup();
 #else
 #if FFTW3F_SUPPORT
-        fftwf_cleanup();
+  fftwf_cleanup();
 #endif
 #endif
