summaryrefslogtreecommitdiffstats
path: root/raul/SRMWQueue.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-12-16 10:30:44 +0100
committerDavid Robillard <d@drobilla.net>2017-12-16 10:30:44 +0100
commitfc22583b1174c9b5e6d0364240431eaca932440d (patch)
tree4d7ac03769a3860c07563621197825cfab14244e /raul/SRMWQueue.hpp
parent4db870b2b20b0a608ec0283139056b836c5b1624 (diff)
downloadraul-fc22583b1174c9b5e6d0364240431eaca932440d.tar.gz
raul-fc22583b1174c9b5e6d0364240431eaca932440d.tar.bz2
raul-fc22583b1174c9b5e6d0364240431eaca932440d.zip
Fix various warnings
Diffstat (limited to 'raul/SRMWQueue.hpp')
-rw-r--r--raul/SRMWQueue.hpp8
1 files changed, 3 insertions, 5 deletions
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<typename T>
SRMWQueue<T>::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<bool>[_size])
{
@@ -145,7 +145,7 @@ SRMWQueue<T>::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<T>::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 <typename T>
inline void