diff src/Silvet.cpp @ 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 59e3cca75b8d 9b9cdfccbd14
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;
                     }
                 }