diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-25 14:49:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-25 14:52:35 +0100 |
commit | ceec1a7d38d4c8941dbf537b85bd50f0030ffbec (patch) | |
tree | 2b137c37ae0f331bb3626583a619a3175ef614d4 /Applications/Piano | |
parent | 9c6f7d3e7d2252ad2d51f2c7c7379cab867fa477 (diff) | |
download | serenity-ceec1a7d38d4c8941dbf537b85bd50f0030ffbec.zip |
AK: Make Vector use size_t for its size and capacity
Diffstat (limited to 'Applications/Piano')
-rw-r--r-- | Applications/Piano/AudioEngine.cpp | 4 | ||||
-rw-r--r-- | Applications/Piano/SamplerWidget.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Applications/Piano/AudioEngine.cpp b/Applications/Piano/AudioEngine.cpp index 97793f170c..e3b8d5c434 100644 --- a/Applications/Piano/AudioEngine.cpp +++ b/Applications/Piano/AudioEngine.cpp @@ -226,11 +226,11 @@ Audio::Sample AudioEngine::noise() const Audio::Sample AudioEngine::recorded_sample(size_t note) { int t = m_pos[note]; - if (t >= m_recorded_sample.size()) + if (t >= static_cast<int>(m_recorded_sample.size())) return 0; double w_left = m_recorded_sample[t].left; double w_right = m_recorded_sample[t].right; - if (t + 1 < m_recorded_sample.size()) { + if (t + 1 < static_cast<int>(m_recorded_sample.size())) { double t_fraction = m_pos[note] - t; w_left += (m_recorded_sample[t + 1].left - m_recorded_sample[t].left) * t_fraction; w_right += (m_recorded_sample[t + 1].right - m_recorded_sample[t].right) * t_fraction; diff --git a/Applications/Piano/SamplerWidget.cpp b/Applications/Piano/SamplerWidget.cpp index 2231afcea3..543cee8ebb 100644 --- a/Applications/Piano/SamplerWidget.cpp +++ b/Applications/Piano/SamplerWidget.cpp @@ -70,7 +70,7 @@ void WaveEditor::paint_event(GUI::PaintEvent& event) painter.set_pixel({ prev_x, left_prev_y }, left_wave_colors[RecordedSample]); painter.set_pixel({ prev_x, right_prev_y }, right_wave_colors[RecordedSample]); - for (int x = 1; x < recorded_sample.size(); ++x) { + for (size_t x = 1; x < recorded_sample.size(); ++x) { int left_y = sample_to_y(recorded_sample[x].left); int right_y = sample_to_y(recorded_sample[x].right); |