From fe8782394f247e915509a3e32a6e0b8614ee783b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 30 Dec 2013 19:17:37 -0400 Subject: [PATCH] examples/: build with -Wdeclaration-after-statement --- examples/aubionotes.c | 5 +++-- examples/aubiopitch.c | 3 ++- examples/utils.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/aubionotes.c b/examples/aubionotes.c index 9c015dad..544bdd8b 100644 --- a/examples/aubionotes.c +++ b/examples/aubionotes.c @@ -47,17 +47,18 @@ uint_t get_note (fvec_t * note_buffer, fvec_t * note_buffer2); void process_block (fvec_t *ibuf, fvec_t *obuf) { + smpl_t new_pitch, curlevel; fvec_zeros(obuf); aubio_onset_do(o, ibuf, onset); aubio_pitch_do (pitch, ibuf, pitch_obuf); - smpl_t new_pitch = fvec_get_sample(pitch_obuf, 0); + new_pitch = fvec_get_sample(pitch_obuf, 0); if(median){ note_append(note_buffer, new_pitch); } /* curlevel is negatif or 1 if silence */ - smpl_t curlevel = aubio_level_detection(ibuf, silence_threshold); + curlevel = aubio_level_detection(ibuf, silence_threshold); if (fvec_get_sample(onset, 0)) { /* test for silence */ if (curlevel == 1.) { diff --git a/examples/aubiopitch.c b/examples/aubiopitch.c index 5dac47a3..5413c2b1 100644 --- a/examples/aubiopitch.c +++ b/examples/aubiopitch.c @@ -30,10 +30,11 @@ fvec_t *pitch; void process_block(fvec_t * ibuf, fvec_t * obuf) { + smpl_t freq; aubio_pitch_do (o, ibuf, pitch); if ( !usejack && ! sink_uri ) return; fvec_zeros(obuf); - smpl_t freq = fvec_get_sample(pitch, 0); + freq = fvec_get_sample(pitch, 0); aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) ); aubio_wavetable_set_freq ( wavetable, freq ); if (mix_input) diff --git a/examples/utils.c b/examples/utils.c index 90687911..186dc808 100644 --- a/examples/utils.c +++ b/examples/utils.c @@ -148,8 +148,8 @@ void examples_common_process (aubio_process_func_t process_func, } else { /* phasevoc */ - blocks = 0; uint_t total_read = 0; + blocks = 0; do { aubio_source_do (this_source, ibuf, &read); -- 2.11.0