comparison examples/FixedTempoEstimator.cpp @ 398:7d59dd1ba5de

Add -Wextra, fix a couple of warnings it throws up
author Chris Cannam
date Tue, 16 Jun 2015 10:54:54 +0100
parents 7178510d747a
children d129bf797f24
comparison
equal deleted inserted replaced
397:14b34e85523b 398:7d59dd1ba5de
429 429
430 int k0 = int(i * related[j] + 0.5); 430 int k0 = int(i * related[j] + 0.5);
431 431
432 if (k0 >= 0 && k0 < int(n/2)) { 432 if (k0 >= 0 && k0 < int(n/2)) {
433 433
434 int kmax = 0, kmin = 0; 434 int kmax = 0;
435 float kvmax = 0, kvmin = 0; 435 float kvmax = 0, kvmin = 0;
436 bool have = false; 436 bool have = false;
437 437
438 for (int k = k0 - 1; k <= k0 + 1; ++k) { 438 for (int k = k0 - 1; k <= k0 + 1; ++k) {
439 439
440 if (k < 0 || k >= n/2) continue; 440 if (k < 0 || k >= n/2) continue;
441 441
442 if (!have || (m_r[k] > kvmax)) { kmax = k; kvmax = m_r[k]; } 442 if (!have || (m_r[k] > kvmax)) { kvmax = m_r[k]; kmax = k; }
443 if (!have || (m_r[k] < kvmin)) { kmin = k; kvmin = m_r[k]; } 443 if (!have || (m_r[k] < kvmin)) { kvmin = m_r[k]; }
444 444
445 have = true; 445 have = true;
446 } 446 }
447 447
448 // Boost the original lag according to the strongest 448 // Boost the original lag according to the strongest