src/, examples/: #ifdef HAVE_, not #if HAVE_
authorPaul Brossier <piem@piem.org>
Sun, 24 Apr 2016 17:00:28 +0000 (19:00 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 24 Apr 2016 17:00:28 +0000 (19:00 +0200)
examples/jackio.c
examples/utils.c
src/cvec.c
src/fmat.c
src/spectral/phasevoc.c

index 475471f..f781fb1 100644 (file)
@@ -21,7 +21,7 @@
 #include <aubio.h>
 #include "config.h"
 
-#if HAVE_JACK
+#ifdef HAVE_JACK
 #include "utils.h" // for aubio_process_func_t
 #include "jackio.h"
 #include "aubio_priv.h"
index a28f409..6bed3ca 100644 (file)
@@ -72,7 +72,7 @@ extern int parse_args (int argc, char **argv);
 
 #if HAVE_JACK
 aubio_jack_t *jack_setup;
-#endif
+#endif /* HAVE_JACK */
 
 void examples_common_init (int argc, char **argv);
 void examples_common_del (void);
@@ -114,7 +114,7 @@ void examples_common_init (int argc, char **argv)
     jack_setup = new_aubio_jack (hop_size, 1, 1, 0, 1);
     samplerate = aubio_jack_get_samplerate (jack_setup);
     source_uri = "jack";
-#endif
+#endif /* HAVE_JACK */
   }
   ibuf = new_fvec (hop_size);
   obuf = new_fvec (hop_size);
@@ -137,16 +137,16 @@ void examples_common_process (aubio_process_func_t process_func,
   uint_t read = 0;
   if (usejack) {
 
-#if HAVE_JACK
+#ifdef HAVE_JACK
     debug ("Jack activation ...\n");
     aubio_jack_activate (jack_setup, process_func);
     debug ("Processing (Ctrl+C to quit) ...\n");
     pause ();
     aubio_jack_close (jack_setup);
-#else
+#else /* HAVE_JACK */
     usage (stderr, 1);
     outmsg ("Compiled without jack output, exiting.\n");
-#endif
+#endif /* HAVE_JACK */
 
   } else {
 
@@ -181,7 +181,7 @@ void
 send_noteon (int pitch, int velo)
 {
   smpl_t mpitch = floor (aubio_freqtomidi (pitch) + .5);
-#if HAVE_JACK
+#ifdef HAVE_JACK
   jack_midi_event_t ev;
   ev.size = 3;
   ev.buffer = malloc (3 * sizeof (jack_midi_data_t)); // FIXME
index b8eb161..2e98cf5 100644 (file)
@@ -85,16 +85,16 @@ void cvec_copy(const cvec_t *s, cvec_t *t) {
         s->length, t->length);
     return;
   }
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
   memcpy(t->norm, s->norm, t->length * sizeof(smpl_t));
   memcpy(t->phas, s->phas, t->length * sizeof(smpl_t));
-#else
+#else /* HAVE_MEMCPY_HACKS */
   uint_t j;
   for (j=0; j< t->length; j++) {
     t->norm[j] = s->norm[j];
     t->phas[j] = s->phas[j];
   }
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
 }
 
 void cvec_norm_set_all (cvec_t *s, smpl_t val) {
@@ -105,11 +105,11 @@ void cvec_norm_set_all (cvec_t *s, smpl_t val) {
 }
 
 void cvec_norm_zeros(cvec_t *s) {
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
   memset(s->norm, 0, s->length * sizeof(smpl_t));
-#else
+#else /* HAVE_MEMCPY_HACKS */
   cvec_norm_set_all (s, 0.);
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
 }
 
 void cvec_norm_ones(cvec_t *s) {
@@ -124,7 +124,7 @@ void cvec_phas_set_all (cvec_t *s, smpl_t val) {
 }
 
 void cvec_phas_zeros(cvec_t *s) {
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
   memset(s->phas, 0, s->length * sizeof(smpl_t));
 #else
   cvec_phas_set_all (s, 0.);
index 679c958..2d404d8 100644 (file)
@@ -93,14 +93,14 @@ void fmat_set(fmat_t *s, smpl_t val) {
 }
 
 void fmat_zeros(fmat_t *s) {
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
   uint_t i;
   for (i=0; i< s->height; i++) {
     memset(s->data[i], 0, s->length * sizeof(smpl_t));
   }
-#else
+#else /* HAVE_MEMCPY_HACKS */
   fmat_set(s, 0.);
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
 }
 
 void fmat_ones(fmat_t *s) {
@@ -128,9 +128,9 @@ void fmat_weight(fmat_t *s, const fmat_t *weight) {
 
 void fmat_copy(const fmat_t *s, fmat_t *t) {
   uint_t i;
-#if !HAVE_MEMCPY_HACKS
+#ifndef HAVE_MEMCPY_HACKS
   uint_t j;
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
   if (s->height != t->height) {
     AUBIO_ERR("trying to copy %d rows to %d rows \n",
             s->height, t->height);
@@ -141,17 +141,17 @@ void fmat_copy(const fmat_t *s, fmat_t *t) {
             s->length, t->length);
     return;
   }
-#if HAVE_MEMCPY_HACKS
+#ifdef HAVE_MEMCPY_HACKS
   for (i=0; i< s->height; i++) {
     memcpy(t->data[i], s->data[i], t->length * sizeof(smpl_t));
   }
-#else
+#else /* HAVE_MEMCPY_HACKS */
   for (i=0; i< t->height; i++) {
     for (j=0; j< t->length; j++) {
       t->data[i][j] = s->data[i][j];
     }
   }
-#endif
+#endif /* HAVE_MEMCPY_HACKS */
 }
 
 void fmat_vecmul(const fmat_t *s, const fvec_t *scale, fvec_t *output) {
index ed299b4..80329db 100644 (file)
@@ -142,7 +142,7 @@ static void aubio_pvoc_swapbuffers(aubio_pvoc_t *pv, const fvec_t *new)
   smpl_t * data = pv->data->data;
   smpl_t * dataold = pv->dataold->data;
   smpl_t * datanew = new->data;
-#if !HAVE_MEMCPY_HACKS
+#ifndef HAVE_MEMCPY_HACKS
   uint_t i;
   for (i = 0; i < pv->end; i++)
     data[i] = dataold[i];