mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 15:14:40 +08:00
Fix issue #761
This commit is contained in:
parent
9cbdd5ffd4
commit
b0059b290f
@ -51,14 +51,14 @@ inline void pad2(int n, fmt::basic_memory_buffer<char, Buffer_Size> &dest)
|
|||||||
}
|
}
|
||||||
if (n > 9) // 10-99
|
if (n > 9) // 10-99
|
||||||
{
|
{
|
||||||
dest.push_back('0' + (n / 10));
|
dest.push_back('0' + static_cast<char>(n / 10));
|
||||||
dest.push_back('0' + (n % 10));
|
dest.push_back('0' + static_cast<char>(n % 10));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (n >= 0) // 0-9
|
if (n >= 0) // 0-9
|
||||||
{
|
{
|
||||||
dest.push_back('0');
|
dest.push_back('0');
|
||||||
dest.push_back('0' + n);
|
dest.push_back('0' + static_cast<char>(n));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// negatives (unlikely, but just in case, let fmt deal with it)
|
// 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
|
if (n > 9) // 10-99
|
||||||
{
|
{
|
||||||
dest.push_back('0');
|
dest.push_back('0');
|
||||||
dest.push_back('0' + n / 10);
|
dest.push_back('0' + static_cast<char>(n / 10));
|
||||||
dest.push_back('0' + n % 10);
|
dest.push_back('0' + static_cast<char>(n % 10));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (n >= 0)
|
if (n >= 0)
|
||||||
{
|
{
|
||||||
dest.push_back('0');
|
dest.push_back('0');
|
||||||
dest.push_back('0');
|
dest.push_back('0');
|
||||||
dest.push_back('0' + n);
|
dest.push_back('0' + static_cast<char>(n));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// negatives (unlikely, but just in case let fmt deal with it)
|
// negatives (unlikely, but just in case let fmt deal with it)
|
||||||
|
@ -175,7 +175,9 @@ private:
|
|||||||
|
|
||||||
void worker_loop_()
|
void worker_loop_()
|
||||||
{
|
{
|
||||||
while (process_next_msg_()) {};
|
while (process_next_msg_())
|
||||||
|
{
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// process next message in the queue
|
// process next message in the queue
|
||||||
@ -210,7 +212,6 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(false);
|
|
||||||
return true; // should not be reached
|
return true; // should not be reached
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user