This commit is contained in:
gabime 2018-07-20 23:26:52 +03:00
parent 9cbdd5ffd4
commit b0059b290f
2 changed files with 25 additions and 24 deletions

View File

@ -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)

View File

@ -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::flush:
{
incoming_async_msg.worker_ptr->backend_flush_();
return true;
}
case async_msg_type::terminate:
{
return false;
}
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;
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
}
};