shithub: aubio

Download patch

ref: e141b232fa2521c56a876636afb7a877d4ff2843
parent: 7e78ad82497f17fe52100db819eb17c513c4638a
author: Paul Brossier <piem@piem.org>
date: Mon Nov 28 12:31:45 EST 2016

src/{fmat,fvec}.c: avoid integer division

--- a/src/fmat.c
+++ b/src/fmat.c
@@ -110,7 +110,7 @@
 void fmat_rev(fmat_t *s) {
   uint_t i,j;
   for (i=0; i< s->height; i++) {
-    for (j=0; j< FLOOR(s->length/2); j++) {
+    for (j=0; j< FLOOR((smpl_t)s->length/2); j++) {
       ELEM_SWAP(s->data[i][j], s->data[i][s->length-1-j]);
     }
   }
--- a/src/fvec.c
+++ b/src/fvec.c
@@ -90,7 +90,7 @@
 
 void fvec_rev(fvec_t *s) {
   uint_t j;
-  for (j=0; j< FLOOR(s->length/2); j++) {
+  for (j=0; j< FLOOR((smpl_t)s->length/2); j++) {
     ELEM_SWAP(s->data[j], s->data[s->length-1-j]);
   }
 }