shithub: aubio

Download patch

ref: 4b6937b60f42819270033ab16d7949ac507461a0
parent: 4368223876c6727ac7a181f6e7f0ae9adfadf563
author: Paul Brossier <piem@piem.org>
date: Wed Nov 7 12:19:31 EST 2007

fft.c: use ifdef, not if, improve indentation

--- a/src/fft.c
+++ b/src/fft.c
@@ -45,7 +45,7 @@
   uint_t channels;
   uint_t fft_size;
   real_t *in, *out;
-  fftw_plan   pfw, pbw;
+  fftw_plan pfw, pbw;
   fft_data_t * specdata;     /* complex spectral data */
   fvec_t * compspec;
 };
@@ -60,7 +60,7 @@
   s->compspec = new_fvec(winsize,channels);
   /* create plans */
 #ifdef HAVE_COMPLEX_H
-  s->fft_size = winsize/2+1;
+  s->fft_size = winsize/2 + 1;
   s->specdata = (fft_data_t*)fftw_malloc(sizeof(fft_data_t)*s->fft_size);
   s->pfw = fftw_plan_dft_r2c_1d(winsize, s->in,  s->specdata, FFTW_ESTIMATE);
   s->pbw = fftw_plan_dft_c2r_1d(winsize, s->specdata, s->out, FFTW_ESTIMATE);
@@ -101,7 +101,7 @@
       s->in[j] = input->data[i][j];
     }
     fftw_execute(s->pfw);
-#if HAVE_COMPLEX_H
+#ifdef HAVE_COMPLEX_H
     compspec->data[i][0] = REAL(s->specdata[0]);
     for (j = 1; j < s->fft_size -1 ; j++) {
       compspec->data[i][j] = REAL(s->specdata[j]);
@@ -120,7 +120,7 @@
   uint_t i, j;
   const smpl_t renorm = 1./(smpl_t)s->winsize;
   for (i = 0; i < compspec->channels; i++) {
-#if HAVE_COMPLEX_H
+#ifdef HAVE_COMPLEX_H
     s->specdata[0] = compspec->data[i][0];
     for (j=1; j < s->fft_size - 1; j++) {
       s->specdata[j] = compspec->data[i][j] +