From fbe4081f4bebf90cd82827bd3ae27887518d6136 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 25 Feb 2020 14:55:04 +0100 Subject: [PATCH] AK: Make Queue use size_t for its size --- AK/Queue.h | 6 +++--- Applications/Piano/AudioEngine.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AK/Queue.h b/AK/Queue.h index 7d67254572..f686fab6e0 100644 --- a/AK/Queue.h +++ b/AK/Queue.h @@ -38,7 +38,7 @@ public: Queue() { } ~Queue() { } - int size() const { return m_size; } + size_t size() const { return m_size; } bool is_empty() const { return m_size == 0; } void enqueue(T&& value) @@ -81,8 +81,8 @@ public: private: SinglyLinkedList>> m_segments; - int m_index_into_first { 0 }; - int m_size { 0 }; + size_t m_index_into_first { 0 }; + size_t m_size { 0 }; }; } diff --git a/Applications/Piano/AudioEngine.cpp b/Applications/Piano/AudioEngine.cpp index e3b8d5c434..50a7f57ce8 100644 --- a/Applications/Piano/AudioEngine.cpp +++ b/Applications/Piano/AudioEngine.cpp @@ -107,7 +107,7 @@ void AudioEngine::fill_buffer(FixedArray& buffer) } if (m_delay) { - if (m_delay_buffers.size() >= m_delay) { + if (m_delay_buffers.size() >= static_cast(m_delay)) { auto to_blend = m_delay_buffers.dequeue(); for (size_t i = 0; i < to_blend->size(); ++i) { buffer[i].left += (*to_blend)[i].left * 0.333333;