- Fixed missing return statements in base_circular_buffer::try_push.

- Fixed array index calculation in base_circular_buffer::clear.
- Removed redundant explicit in srslog::backend_worker.
master
faluco 4 years ago committed by faluco
parent b06ef3f390
commit 4b5e15cd70

@ -151,6 +151,7 @@ public:
return false; return false;
} }
push(std::move(t)); push(std::move(t));
return true;
} }
bool try_push(const T& t) bool try_push(const T& t)
@ -159,6 +160,7 @@ public:
return false; return false;
} }
push(t); push(t);
return true;
} }
void pop() void pop()
{ {
@ -180,7 +182,7 @@ public:
void clear() void clear()
{ {
for (size_t i = 0; i < count; ++i) { for (size_t i = 0; i < count; ++i) {
buffer[rpos + i].destroy(); buffer[(rpos + i) % max_size()].destroy();
} }
count = 0; count = 0;
} }

@ -32,7 +32,7 @@ class backend_worker
static constexpr unsigned sleep_period_ms = 500; static constexpr unsigned sleep_period_ms = 500;
public: public:
explicit backend_worker(detail::work_queue<detail::log_entry>& queue, detail::dyn_arg_store_pool& arg_pool) : backend_worker(detail::work_queue<detail::log_entry>& queue, detail::dyn_arg_store_pool& arg_pool) :
queue(queue), arg_pool(arg_pool), running_flag(false) queue(queue), arg_pool(arg_pool), running_flag(false)
{} {}

Loading…
Cancel
Save