]> git.sesse.net Git - kdenlive/blobdiff - src/audioscopes/ffttools.cpp
Fix a couple of compile warnings because of unused and uninitialized variables.
[kdenlive] / src / audioscopes / ffttools.cpp
index 4b34430b09df06b46999dcbf5f93e88f6cf0c2a6..3d1ae83fb624dba7639e56deca026735dbedffc7 100644 (file)
@@ -245,7 +245,7 @@ const QVector<float> FFTTools::interpolatePeakPreserving(const QVector<float> in
 
     float x;
     float x_prev = 0;
-    int xi;
+    uint xi;
     uint i;
     if (((float) (right-left))/targetSize < 2) {
         for (i = 0; i < targetSize; i++) {
@@ -266,7 +266,7 @@ const QVector<float> FFTTools::interpolatePeakPreserving(const QVector<float> in
 
 
             // Use linear interpolation in order to get smoother display
-            if (xi == 0 || xi == in.size()-1) {
+            if (xi == 0 || xi == (uint) in.size()-1) {
                 // ... except if we are at the left or right border of the input sigal.
                 // Special case here since we consider previous and future values as well for
                 // the actual interpolation (not possible here).
@@ -292,7 +292,7 @@ const QVector<float> FFTTools::interpolatePeakPreserving(const QVector<float> in
         // If there are more than 2 samples per pixel in average, then use the maximum of them
         // since by only looking at the left sample we might miss some maxima.
         uint src = left;
-        int xi_prev = 0;
+//         int xi_prev = 0;
         int points;
 
 #ifdef DEBUG_FFTTOOLS
@@ -309,14 +309,14 @@ const QVector<float> FFTTools::interpolatePeakPreserving(const QVector<float> in
 
             out[i] = fill;
 
-            for (; src < xi && src < in.size(); src++) {
+            for (; src < xi && src < (uint) in.size(); src++) {
                 if (out[i] < in[src]) {
                     out[i] = in[src];
                 }
                 points++;
             }
 
-            xi_prev = xi;
+//             xi_prev = xi;
         }
     }
     // Fill the rest of the vector if the right border exceeds the input vector.