Commit 2c854cc8 authored by gabime's avatar gabime

fixed gcc shadow warnings

parent df898267
...@@ -87,7 +87,7 @@ class async_log_helper ...@@ -87,7 +87,7 @@ class async_log_helper
public: public:
using q_type = details::mpsc_q < std::unique_ptr<async_msg> >; using q_type = details::mpsc_q < std::unique_ptr<async_msg> >;
using clock = std::chrono::monotonic_clock; using clock = std::chrono::steady_clock;
explicit async_log_helper(size_t max_queue_size); explicit async_log_helper(size_t max_queue_size);
...@@ -175,16 +175,16 @@ inline void spdlog::details::async_log_helper::_thread_loop() ...@@ -175,16 +175,16 @@ inline void spdlog::details::async_log_helper::_thread_loop()
clock::time_point last_pop = clock::now(); clock::time_point last_pop = clock::now();
while (_active) while (_active)
{ {
q_type::item_type async_msg; q_type::item_type popped_msg;
if (_q.pop(async_msg)) if (_q.pop(popped_msg))
{ {
last_pop = clock::now(); last_pop = clock::now();
try try
{ {
details::log_msg log_msg = async_msg->to_log_msg(); details::log_msg log_msg = popped_msg->to_log_msg();
_formatter->format(log_msg); _formatter->format(log_msg);
for (auto &s : _sinks) for (auto &s : _sinks)
......
...@@ -89,11 +89,11 @@ public: ...@@ -89,11 +89,11 @@ public:
} }
template<typename TT> template<typename TT>
bool push(TT&& value) bool push(TT&& val)
{ {
if (_size >= _max_size) if (_size >= _max_size)
return false; return false;
mpscq_node_t* new_node = new mpscq_node_t(std::forward<TT>(value)); mpscq_node_t* new_node = new mpscq_node_t(std::forward<TT>(val));
push_node(new_node); push_node(new_node);
++_size; ++_size;
return true; return true;
...@@ -143,13 +143,13 @@ private: ...@@ -143,13 +143,13 @@ private:
mpscq_node_t(const mpscq_node_t&) = delete; mpscq_node_t(const mpscq_node_t&) = delete;
mpscq_node_t& operator=(const mpscq_node_t&) = delete; mpscq_node_t& operator=(const mpscq_node_t&) = delete;
explicit mpscq_node_t(const T& value): explicit mpscq_node_t(const T& val):
next(nullptr), next(nullptr),
value(value) {} value(val) {}
explicit mpscq_node_t(T&& value) : explicit mpscq_node_t(T&& val) :
next(nullptr), next(nullptr),
value(std::move(value)) {} value(std::move(val)) {}
}; };
size_t _max_size; size_t _max_size;
...@@ -201,4 +201,4 @@ private: ...@@ -201,4 +201,4 @@ private:
}; };
} }
} }
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment