summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/raul/RingBuffer.hpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/raul/RingBuffer.hpp b/include/raul/RingBuffer.hpp
index 17ce5f4..c326cb9 100644
--- a/include/raul/RingBuffer.hpp
+++ b/include/raul/RingBuffer.hpp
@@ -31,9 +31,7 @@ public:
@param size Size in bytes (note this may be rounded up).
*/
explicit RingBuffer(uint32_t size)
- : _write_head(0)
- , _read_head(0)
- , _size(next_power_of_two(size))
+ : _size(next_power_of_two(size))
, _size_mask(_size - 1)
, _buf(new char[_size])
{
@@ -191,8 +189,8 @@ private:
return size;
}
- mutable uint32_t _write_head; ///< Read index into _buf
- mutable uint32_t _read_head; ///< Write index into _buf
+ mutable uint32_t _write_head{}; ///< Read index into _buf
+ mutable uint32_t _read_head{}; ///< Write index into _buf
const uint32_t _size; ///< Size (capacity) in bytes
const uint32_t _size_mask; ///< Mask for fast modulo