From fc22583b1174c9b5e6d0364240431eaca932440d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Dec 2017 10:30:44 +0100 Subject: Fix various warnings --- raul/SRMWQueue.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'raul/SRMWQueue.hpp') diff --git a/raul/SRMWQueue.hpp b/raul/SRMWQueue.hpp index b4d43ee..769364c 100644 --- a/raul/SRMWQueue.hpp +++ b/raul/SRMWQueue.hpp @@ -85,8 +85,8 @@ template SRMWQueue::SRMWQueue(size_t size) : _front(0) , _back(0) - , _write_space(size) - , _size(size+1) + , _write_space(int(size)) + , _size(unsigned(size) + 1) , _objects((T*)calloc(_size, sizeof(T))) , _valid(new std::atomic[_size]) { @@ -145,7 +145,7 @@ SRMWQueue::push(const T& elem) } else { // Note: _size must be a power of 2 for this to not explode when _back overflows - const unsigned write_index = _back++ % _size; + const unsigned write_index = unsigned(_back++) % _size; assert(!_valid[write_index]); _objects[write_index] = elem; @@ -182,8 +182,6 @@ SRMWQueue::front() const * * It is a fatal error to call pop() if the queue is empty. * Read thread only. - * - * @return true if queue is now empty, otherwise false. */ template inline void -- cgit v1.2.1