shithub: aubio

Download patch

ref: 4bf3731bf9cf6b6090d0d76338e2db0a4feb4432
parent: d04875c75015d1600ef7191c534cca7c1b1f2823
author: Paul Brossier <piem@piem.org>
date: Tue Feb 16 13:00:27 EST 2016

src/mathutils.c: avoid for loop initial declarations [gcc]

--- a/src/mathutils.c
+++ b/src/mathutils.c
@@ -253,11 +253,11 @@
 void
 fvec_shift (fvec_t * s)
 {
-  uint_t half = s->length / 2, start = half;
+  uint_t half = s->length / 2, start = half, j;
   // if length is odd, middle element is moved to the end
   if (2 * half < s->length) start ++;
 #ifndef HAVE_ATLAS
-  for (uint_t j = 0; j < half; j++) {
+  for (j = 0; j < half; j++) {
     ELEM_SWAP (s->data[j], s->data[j + start]);
   }
 #else
@@ -264,7 +264,7 @@
   aubio_cblas_swap(half, s->data, 1, s->data + start, 1);
 #endif
   if (start != half) {
-    for (uint_t j = 0; j < half; j++) {
+    for (j = 0; j < half; j++) {
       ELEM_SWAP (s->data[j + start - 1], s->data[j + start]);
     }
   }
@@ -273,11 +273,11 @@
 void
 fvec_ishift (fvec_t * s)
 {
-  uint_t half = s->length / 2, start = half;
+  uint_t half = s->length / 2, start = half, j;
   // if length is odd, middle element is moved to the beginning
   if (2 * half < s->length) start ++;
 #ifndef HAVE_ATLAS
-  for (uint_t j = 0; j < half; j++) {
+  for (j = 0; j < half; j++) {
     ELEM_SWAP (s->data[j], s->data[j + start]);
   }
 #else
@@ -284,7 +284,7 @@
   aubio_cblas_swap(half, s->data, 1, s->data + start, 1);
 #endif
   if (start != half) {
-    for (uint_t j = 0; j < half; j++) {
+    for (j = 0; j < half; j++) {
       ELEM_SWAP (s->data[half], s->data[j]);
     }
   }