Index: src/cvec.c
===================================================================
--- src/cvec.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/cvec.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -23,8 +23,9 @@
 
 cvec_t * new_cvec( uint_t length) {
+  cvec_t * s;
   if ((sint_t)length <= 0) {
     return NULL;
   }
-  cvec_t * s = AUBIO_NEW(cvec_t);
+  s = AUBIO_NEW(cvec_t);
   s->length = length/2 + 1;
   s->norm = AUBIO_ARRAY(smpl_t,s->length);
Index: src/fmat.c
===================================================================
--- src/fmat.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/fmat.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -23,9 +23,10 @@
 
 fmat_t * new_fmat (uint_t height, uint_t length) {
+  fmat_t * s;
+  uint_t i,j;
   if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
     return NULL;
   }
-  fmat_t * s = AUBIO_NEW(fmat_t);
-  uint_t i,j;
+  s = AUBIO_NEW(fmat_t);
   s->height = height;
   s->length = length;
@@ -127,4 +128,8 @@
 
 void fmat_copy(fmat_t *s, fmat_t *t) {
+  uint_t i;
+#if !HAVE_MEMCPY_HACKS
+  uint_t i,j;
+#endif
   if (s->height != t->height) {
     AUBIO_ERR("trying to copy %d rows to %d rows \n",
@@ -138,10 +143,8 @@
   }
 #if HAVE_MEMCPY_HACKS
-  uint_t i;
   for (i=0; i< s->height; i++) {
     memcpy(t->data[i], s->data[i], t->length * sizeof(smpl_t));
   }
 #else
-  uint_t i,j;
   for (i=0; i< t->height; i++) {
     for (j=0; j< t->length; j++) {
Index: src/fvec.c
===================================================================
--- src/fvec.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/fvec.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -23,8 +23,9 @@
 
 fvec_t * new_fvec( uint_t length) {
+  fvec_t * s;
   if ((sint_t)length <= 0) {
     return NULL;
   }
-  fvec_t * s = AUBIO_NEW(fvec_t);
+  s = AUBIO_NEW(fvec_t);
   s->length = length;
   s->data = AUBIO_ARRAY(smpl_t, s->length);
Index: src/io/sink_sndfile.c
===================================================================
--- src/io/sink_sndfile.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/io/sink_sndfile.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -47,4 +47,5 @@
 aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate) {
   aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t);
+  SF_INFO sfinfo;
 
   if (path == NULL) {
@@ -59,5 +60,4 @@
 
   /* set output format */
-  SF_INFO sfinfo;
   AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo));
   sfinfo.samplerate = s->samplerate;
@@ -92,4 +92,5 @@
   int nsamples = channels*write;
   smpl_t *pwrite;
+  sf_count_t written_frames;
 
   if (write > s->max_size) {
@@ -107,5 +108,5 @@
   }
 
-  sf_count_t written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
+  written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
   if (written_frames/channels != write) {
     AUBIO_WRN("trying to write %d frames to %s, but only %d could be written",
Index: src/lvec.c
===================================================================
--- src/lvec.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/lvec.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -23,8 +23,9 @@
 
 lvec_t * new_lvec( uint_t length) {
+  lvec_t * s;
   if ((sint_t)length <= 0) {
     return NULL;
   }
-  lvec_t * s = AUBIO_NEW(lvec_t);
+  s = AUBIO_NEW(lvec_t);
   s->length = length;
   s->data = AUBIO_ARRAY(lsmp_t, s->length);
Index: src/mathutils.c
===================================================================
--- src/mathutils.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/mathutils.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -50,8 +50,9 @@
 {
   fvec_t * win = new_fvec (length);
+  uint_t err;
   if (win == NULL) {
     return NULL;
   }
-  uint_t err = fvec_set_window (win, window_type);
+  err = fvec_set_window (win, window_type);
   if (err != 0) {
     del_fvec(win);
Index: src/pitch/pitch.c
===================================================================
--- src/pitch/pitch.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/pitch/pitch.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -367,8 +367,9 @@
 aubio_pitch_do_specacf (aubio_pitch_t * p, fvec_t * ibuf, fvec_t * out)
 {
+  smpl_t pitch = 0., period;
   aubio_pitch_slideblock (p, ibuf);
   aubio_pitchspecacf_do (p->p_object, p->buf, out);
   //out->data[0] = aubio_bintofreq (out->data[0], p->samplerate, p->bufsize);
-  smpl_t pitch = 0., period = out->data[0];
+  period = out->data[0];
   if (period > 0) {
     pitch = p->samplerate / period;
Index: src/pitch/pitchspecacf.c
===================================================================
--- src/pitch/pitchspecacf.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/pitch/pitchspecacf.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -57,5 +57,5 @@
 aubio_pitchspecacf_do (aubio_pitchspecacf_t * p, fvec_t * input, fvec_t * output)
 {
-  uint_t l;
+  uint_t l, tau;
   fvec_t *fftout = p->fftout;
   // window the input
@@ -75,5 +75,5 @@
   }
   // get the minimum
-  uint_t tau = fvec_min_elem (p->acf);
+  tau = fvec_min_elem (p->acf);
   // get the interpolated minimum
   output->data[0] = fvec_quadratic_peak_pos (p->acf, tau) * 2.;
Index: src/pitch/pitchyinfft.c
===================================================================
--- src/pitch/pitchyinfft.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/pitch/pitchyinfft.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -58,4 +58,6 @@
 new_aubio_pitchyinfft (uint_t samplerate, uint_t bufsize)
 {
+  uint_t i = 0, j = 1;
+  smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0;
   aubio_pitchyinfft_t *p = AUBIO_NEW (aubio_pitchyinfft_t);
   p->winput = new_fvec (bufsize);
@@ -67,6 +69,4 @@
   p->win = new_aubio_window ("hanningz", bufsize);
   p->weight = new_fvec (bufsize / 2 + 1);
-  uint_t i = 0, j = 1;
-  smpl_t freq = 0, a0 = 0, a1 = 0, f0 = 0, f1 = 0;
   for (i = 0; i < p->weight->length; i++) {
     freq = (smpl_t) i / (smpl_t) bufsize *(smpl_t) samplerate;
Index: src/synth/wavetable.c
===================================================================
--- src/synth/wavetable.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/synth/wavetable.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -43,4 +43,5 @@
 aubio_wavetable_t *new_aubio_wavetable(uint_t samplerate, uint_t blocksize)
 {
+  uint_t i = 0;
   aubio_wavetable_t *s = AUBIO_NEW(aubio_wavetable_t);
   if ((sint_t)samplerate <= 0) {
@@ -48,5 +49,4 @@
     goto beach;
   }
-  uint_t i = 0;
   s->samplerate = samplerate;
   s->blocksize = blocksize;
@@ -115,4 +115,5 @@
     for (j = 0; j < output->length; j++) {
       smpl_t inc = aubio_parameter_get_next_value( s->freq );
+      smpl_t amp = aubio_parameter_get_next_value ( s->amp );
       inc *= (smpl_t)(s->wavetable_length) / (smpl_t) (s->samplerate);
       pos += inc;
@@ -120,5 +121,4 @@
         pos -= s->wavetable_length;
       }
-      smpl_t amp = aubio_parameter_get_next_value ( s->amp );
       for (i = 0; i < output->height; i++) {
         output->data[i][j] = amp * interp_2(s->wavetable, pos);
Index: src/tempo/beattracking.c
===================================================================
--- src/tempo/beattracking.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/tempo/beattracking.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -62,6 +62,4 @@
   aubio_beattracking_t *p = AUBIO_NEW (aubio_beattracking_t);
   uint_t i = 0;
-  p->hop_size = hop_size;
-  p->samplerate = samplerate;
   /* default value for rayleigh weighting - sets preferred tempo to 120bpm */
   smpl_t rayparam = 60. * samplerate / 120. / hop_size;
@@ -73,4 +71,6 @@
   uint_t step = winlen / 4;     /* 1.5 seconds */
 
+  p->hop_size = hop_size;
+  p->samplerate = samplerate;
   p->lastbeat = 0;
   p->counter = 0;
Index: src/temporal/a_weighting.c
===================================================================
--- src/temporal/a_weighting.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/temporal/a_weighting.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -29,9 +29,10 @@
 aubio_filter_set_a_weighting (aubio_filter_t * f, uint_t samplerate)
 {
+  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
   aubio_filter_set_samplerate (f, samplerate);
-  lvec_t *bs = aubio_filter_get_feedforward (f);
-  lvec_t *as = aubio_filter_get_feedback (f);
-  lsmp_t *b = bs->data, *a = as->data;
-  uint_t order = aubio_filter_get_order (f);
+  bs = aubio_filter_get_feedforward (f);
+  as = aubio_filter_get_feedback (f);
+  b = bs->data, a = as->data;
+  order = aubio_filter_get_order (f);
 
   if (order != 7) {
Index: src/temporal/c_weighting.c
===================================================================
--- src/temporal/c_weighting.c	(revision 029bf4e8ccfb5c3e74de9d6cd45d258b7f8d772d)
+++ src/temporal/c_weighting.c	(revision c21acb9af53c574313b6265afe6806cc69b4ee43)
@@ -29,9 +29,10 @@
 aubio_filter_set_c_weighting (aubio_filter_t * f, uint_t samplerate)
 {
+  uint_t order; lsmp_t *a, *b; lvec_t *as, *bs;
   aubio_filter_set_samplerate (f, samplerate);
-  lvec_t *bs = aubio_filter_get_feedforward (f);
-  lvec_t *as = aubio_filter_get_feedback (f);
-  lsmp_t *b = bs->data, *a = as->data;
-  uint_t order = aubio_filter_get_order (f);
+  bs = aubio_filter_get_feedforward (f);
+  as = aubio_filter_get_feedback (f);
+  b = bs->data, a = as->data;
+  order = aubio_filter_get_order (f);
 
   if ( order != 5 ) {
