Commit b0059b29 authored by gabime's avatar gabime

Fix issue #761

parent 9cbdd5ff
......@@ -51,14 +51,14 @@ inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
}
if (n > 9) // 10-99
{
dest.push_back('0' + (n / 10));
dest.push_back('0' + (n % 10));
dest.push_back('0' + static_cast<char>(n / 10));
dest.push_back('0' + static_cast<char>(n % 10));
return;
}
if (n >= 0) // 0-9
{
dest.push_back('0');
dest.push_back('0' + n);
dest.push_back('0' + static_cast<char>(n));
return;
}
// negatives (unlikely, but just in case, let fmt deal with it)
......@@ -76,15 +76,15 @@ inline void pad3(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
if (n > 9) // 10-99
{
dest.push_back('0');
dest.push_back('0' + n / 10);
dest.push_back('0' + n % 10);
dest.push_back('0' + static_cast<char>(n / 10));
dest.push_back('0' + static_cast<char>(n % 10));
return;
}
if (n >= 0)
{
dest.push_back('0');
dest.push_back('0');
dest.push_back('0' + n);
dest.push_back('0' + static_cast<char>(n));
return;
}
// negatives (unlikely, but just in case let fmt deal with it)
......
......@@ -175,7 +175,9 @@ private:
void worker_loop_()
{
while (process_next_msg_()) {};
while (process_next_msg_())
{
};
}
// process next message in the queue
......@@ -191,26 +193,25 @@ private:
switch (incoming_async_msg.msg_type)
{
case async_msg_type::flush:
{
incoming_async_msg.worker_ptr->backend_flush_();
return true;
}
case async_msg_type::terminate:
{
return false;
}
default:
{
log_msg msg;
incoming_async_msg.to_log_msg(msg);
incoming_async_msg.worker_ptr->backend_log_(msg);
return true;
}
case async_msg_type::flush:
{
incoming_async_msg.worker_ptr->backend_flush_();
return true;
}
case async_msg_type::terminate:
{
return false;
}
default:
{
log_msg msg;
incoming_async_msg.to_log_msg(msg);
incoming_async_msg.worker_ptr->backend_log_(msg);
return true;
}
}
assert(false);
return true; // should not be reached
}
};
......
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