shithub: aubio

Download patch

ref: fe8782394f247e915509a3e32a6e0b8614ee783b
parent: 0546c1f3b0414b6cb48250b7e8a4c46c420536d8
author: Paul Brossier <[email protected]>
date: Mon Dec 30 14:17:37 EST 2013

examples/: build with -Wdeclaration-after-statement

--- a/examples/aubionotes.c
+++ b/examples/aubionotes.c
@@ -47,17 +47,18 @@
 
 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.) {
--- a/examples/aubiopitch.c
+++ b/examples/aubiopitch.c
@@ -30,10 +30,11 @@
 
 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)
--- a/examples/utils.c
+++ b/examples/utils.c
@@ -148,8 +148,8 @@
 
   } else {
     /* phasevoc */
-    blocks = 0;
     uint_t total_read = 0;
+    blocks = 0;
 
     do {
       aubio_source_do (this_source, ibuf, &read);