changeset 179:825193ef09d2

Fix incorrect use of int for non-integer shift weights
author Chris Cannam
date Thu, 22 May 2014 15:06:37 +0100
parents a53c713b2a4a
children 2931089cda46 10e7c3ff575e 59e3cca75b8d
files src/Silvet.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/Silvet.cpp	Thu May 22 12:11:33 2014 +0100
+++ b/src/Silvet.cpp	Thu May 22 15:06:37 2014 +0100
@@ -492,11 +492,12 @@
             localPitches[i][j] = pitchDist[j] * sum;
 
             int bestShift = 0;
-            int bestShiftValue = 0.0;
+            float bestShiftValue = 0.0;
             if (wantShifts) {
                 for (int k = 0; k < shiftCount; ++k) {
-                    if (k == 0 || shiftDist[k][j] > bestShiftValue) {
-                        bestShiftValue = shiftDist[k][j];
+                    float value = shiftDist[k][j];
+                    if (k == 0 || value > bestShiftValue) {
+                        bestShiftValue = value;
                         bestShift = k;
                     }
                 }