From 75858228013a15f4389a6370f82c488836f0bc02 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 24 Apr 2016 19:00:28 +0200 Subject: [PATCH] src/, examples/: #ifdef HAVE_, not #if HAVE_ --- examples/jackio.c | 2 +- examples/utils.c | 12 ++++++------ src/cvec.c | 14 +++++++------- src/fmat.c | 16 ++++++++-------- src/spectral/phasevoc.c | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/jackio.c b/examples/jackio.c index 475471fd..f781fb16 100644 --- a/examples/jackio.c +++ b/examples/jackio.c @@ -21,7 +21,7 @@ #include #include "config.h" -#if HAVE_JACK +#ifdef HAVE_JACK #include "utils.h" // for aubio_process_func_t #include "jackio.h" #include "aubio_priv.h" diff --git a/examples/utils.c b/examples/utils.c index a28f4097..6bed3cab 100644 --- a/examples/utils.c +++ b/examples/utils.c @@ -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 diff --git a/src/cvec.c b/src/cvec.c index b8eb1614..2e98cf5f 100644 --- a/src/cvec.c +++ b/src/cvec.c @@ -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.); diff --git a/src/fmat.c b/src/fmat.c index 679c9585..2d404d8d 100644 --- a/src/fmat.c +++ b/src/fmat.c @@ -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) { diff --git a/src/spectral/phasevoc.c b/src/spectral/phasevoc.c index ed299b49..80329db7 100644 --- a/src/spectral/phasevoc.c +++ b/src/spectral/phasevoc.c @@ -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]; -- 2.11.0