From 285a2cafe6fec231a7bc75cf73c72d5a79fa3b04 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 10 Apr 2021 19:06:40 +0100 Subject: [PATCH] Change int index parameter to size_t --- include/etl/circular_buffer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/etl/circular_buffer.h b/include/etl/circular_buffer.h index 7d514a6d..c8026e92 100644 --- a/include/etl/circular_buffer.h +++ b/include/etl/circular_buffer.h @@ -812,7 +812,7 @@ namespace etl //************************************************************************* /// Get a reference to the item. //************************************************************************* - reference operator [](int index) + reference operator [](size_t index) { return pbuffer[(out + index) % BUFFER_SIZE]; } @@ -821,7 +821,7 @@ namespace etl /// Get a const reference to the item at the back of the buffer. /// Asserts an error if the buffer is empty. //************************************************************************* - const_reference operator [](int index) const + const_reference operator [](size_t index) const { return pbuffer[(out + index) % BUFFER_SIZE]; }