Mercurial > hg > qm-vamp-plugins
diff plugins/SimilarityPlugin.cpp @ 178:f96ea0e4b475
Fix compiler warnings with -Wall -Wextra
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 28 Sep 2015 12:33:17 +0100 |
parents | dcf5800f0f00 |
children | af6a5ba00a8f |
line wrap: on
line diff
--- a/plugins/SimilarityPlugin.cpp Tue Sep 08 17:32:03 2015 +0100 +++ b/plugins/SimilarityPlugin.cpp Mon Sep 28 12:33:17 2015 +0100 @@ -507,19 +507,19 @@ void SimilarityPlugin::reset() { - for (int i = 0; i < m_values.size(); ++i) { + for (int i = 0; i < int(m_values.size()); ++i) { m_values[i].clear(); } - for (int i = 0; i < m_rhythmValues.size(); ++i) { + for (int i = 0; i < int(m_rhythmValues.size()); ++i) { m_rhythmValues[i].clear(); } - for (int i = 0; i < m_lastNonEmptyFrame.size(); ++i) { + for (int i = 0; i < int(m_lastNonEmptyFrame.size()); ++i) { m_lastNonEmptyFrame[i] = -1; } - for (int i = 0; i < m_emptyFrameCount.size(); ++i) { + for (int i = 0; i < int(m_emptyFrameCount.size()); ++i) { m_emptyFrameCount[i] = 0; } @@ -544,7 +544,7 @@ bool someRhythmFrameNeeded = false; - for (size_t c = 0; c < m_channels; ++c) { + for (int c = 0; c < m_channels; ++c) { bool empty = true; @@ -557,7 +557,7 @@ if (empty) { if (needRhythm() && ((m_frameNo % 2) == 0)) { for (int i = 0; i < m_fftSize / m_rhythmClipFrameSize; ++i) { - if (m_rhythmValues[c].size() < m_rhythmClipFrames) { + if (int(m_rhythmValues[c].size()) < m_rhythmClipFrames) { FeatureColumn mf(m_rhythmColumnSize); for (int i = 0; i < m_rhythmColumnSize; ++i) { mf[i] = 0.0; @@ -609,7 +609,7 @@ bool needRhythmFrame = true; - if (m_rhythmValues[c].size() >= m_rhythmClipFrames) { + if (int(m_rhythmValues[c].size()) >= m_rhythmClipFrames) { needRhythmFrame = false; @@ -681,7 +681,9 @@ int sz = m_lastNonEmptyFrame[i] - m_emptyFrameCount[i]; if (sz < 0) sz = 0; - if (sz >= m_values[i].size()) sz = m_values[i].size()-1; + if (sz >= int(m_values[i].size())) { + sz = int(m_values[i].size())-1; + } count = 0; for (int k = 0; k < sz; ++k) { @@ -803,7 +805,7 @@ FeatureMatrixSet bsinput(m_channels); for (int i = 0; i < m_channels; ++i) { - for (int j = 0; j < m_rhythmValues[i].size(); ++j) { + for (int j = 0; j < int(m_rhythmValues[i].size()); ++j) { bsinput[i].push_back(m_rhythmValues[i][j]); } } @@ -834,7 +836,7 @@ feature.label = labelBuffer; feature.values.clear(); - for (int j = 0; j < bs[i].size(); ++j) { + for (int j = 0; j < int(bs[i].size()); ++j) { feature.values.push_back(bs[i][j]); }