examples/: build with -Wdeclaration-after-statement
authorPaul Brossier <piem@piem.org>
Mon, 30 Dec 2013 23:17:37 +0000 (19:17 -0400)
committerPaul Brossier <piem@piem.org>
Mon, 30 Dec 2013 23:17:37 +0000 (19:17 -0400)
examples/aubionotes.c
examples/aubiopitch.c
examples/utils.c

index 9c015da..544bdd8 100644 (file)
@@ -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.) {
index 5dac47a..5413c2b 100644 (file)
@@ -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)
index 9068791..186dc80 100644 (file)
@@ -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);