shithub: aubio

Download patch

ref: 75858228013a15f4389a6370f82c488836f0bc02
parent: 8b2aafd78c3f5c08ce9b380bd3cd0c8d2afd3ada
author: Paul Brossier <piem@piem.org>
date: Sun Apr 24 15:00:28 EDT 2016

src/, examples/: #ifdef HAVE_, not #if HAVE_

--- a/examples/jackio.c
+++ b/examples/jackio.c
@@ -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"
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -72,7 +72,7 @@
 
 #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 @@
     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 @@
   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 @@
 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
--- a/src/cvec.c
+++ b/src/cvec.c
@@ -85,16 +85,16 @@
         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_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_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.);
--- a/src/fmat.c
+++ b/src/fmat.c
@@ -93,14 +93,14 @@
 }
 
 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_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 @@
             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) {
--- a/src/spectral/phasevoc.c
+++ b/src/spectral/phasevoc.c
@@ -142,7 +142,7 @@
   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];