Commit db1babab authored by gabime's avatar gabime

Fixed some msvc code analysis warnings

parent 7ea95161
...@@ -40,7 +40,8 @@ struct async_factory_impl ...@@ -40,7 +40,8 @@ struct async_factory_impl
auto &registry_inst = details::registry::instance(); auto &registry_inst = details::registry::instance();
// create global thread pool if not already exists.. // create global thread pool if not already exists..
std::lock_guard<std::recursive_mutex> tp_lock(registry_inst.tp_mutex()); auto& mutex = registry_inst.tp_mutex();
std::lock_guard<std::recursive_mutex> tp_lock(mutex);
auto tp = registry_inst.get_tp(); auto tp = registry_inst.get_tp();
if (tp == nullptr) if (tp == nullptr)
{ {
......
...@@ -1259,10 +1259,10 @@ SPDLOG_INLINE details::padding_info pattern_formatter::handle_padspec_(std::stri ...@@ -1259,10 +1259,10 @@ SPDLOG_INLINE details::padding_info pattern_formatter::handle_padspec_(std::stri
return padding_info{0, side}; return padding_info{0, side};
} }
auto width = static_cast<size_t>(*it - '0'); auto width = static_cast<size_t>(*it) - '0';
for (++it; it != end && std::isdigit(static_cast<unsigned char>(*it)); ++it) for (++it; it != end && std::isdigit(static_cast<unsigned char>(*it)); ++it)
{ {
auto digit = static_cast<size_t>(*it - '0'); auto digit = static_cast<size_t>(*it) - '0';
width = width * 10 + digit; width = width * 10 + digit;
} }
return details::padding_info{std::min<size_t>(width, max_width), side}; return details::padding_info{std::min<size_t>(width, max_width), side};
......
...@@ -31,16 +31,20 @@ enum class async_msg_type ...@@ -31,16 +31,20 @@ enum class async_msg_type
// Movable only. should never be copied // Movable only. should never be copied
struct async_msg struct async_msg
{ {
async_msg_type msg_type; async_msg_type msg_type;
level::level_enum level; level::level_enum level;
log_clock::time_point time; log_clock::time_point time;
size_t thread_id; size_t thread_id;
fmt::basic_memory_buffer<char, 176> raw; fmt::basic_memory_buffer<char, 176> raw;
source_loc source; source_loc source;
async_logger_ptr worker_ptr; async_logger_ptr worker_ptr;
async_msg() = default; async_msg()
:msg_type(async_msg_type::log),
level(level::info),
thread_id(0)
{}
~async_msg() = default; ~async_msg() = default;
// should only be moved in or out of the queue.. // should only be moved in or out of the queue..
...@@ -48,7 +52,7 @@ struct async_msg ...@@ -48,7 +52,7 @@ struct async_msg
// support for vs2013 move // support for vs2013 move
#if defined(_MSC_VER) && _MSC_VER <= 1800 #if defined(_MSC_VER) && _MSC_VER <= 1800
async_msg(async_msg &&other) SPDLOG_NOEXCEPT : msg_type(other.msg_type), async_msg(async_msg &&other) : msg_type(other.msg_type),
level(other.level), level(other.level),
time(other.time), time(other.time),
thread_id(other.thread_id), thread_id(other.thread_id),
...@@ -58,7 +62,7 @@ struct async_msg ...@@ -58,7 +62,7 @@ struct async_msg
worker_ptr(std::move(other.worker_ptr)) worker_ptr(std::move(other.worker_ptr))
{} {}
async_msg &operator=(async_msg &&other) SPDLOG_NOEXCEPT async_msg &operator=(async_msg &&other)
{ {
msg_type = other.msg_type; msg_type = other.msg_type;
level = other.level; level = other.level;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
Test message 2
Test message 4
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