1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

AK: Make Vector use size_t for its size and capacity

This commit is contained in:
Andreas Kling 2020-02-25 14:49:47 +01:00
parent 9c6f7d3e7d
commit ceec1a7d38
94 changed files with 323 additions and 317 deletions

View file

@ -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;

View file

@ -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);