|
|
|
@ -73,12 +73,13 @@ inline void pad_uint(T n, unsigned int width, memory_buf_t &dest)
|
|
|
|
|
template<typename T>
|
|
|
|
|
inline void pad3(T n, memory_buf_t &dest)
|
|
|
|
|
{
|
|
|
|
|
static_assert(std::is_unsigned<T>::value, "pad_uint must get unsigned T");
|
|
|
|
|
if(n < 1000)
|
|
|
|
|
{
|
|
|
|
|
dest.push_back(n / 100 + '0');
|
|
|
|
|
dest.push_back(static_cast<char>(n / 100 + '0'));
|
|
|
|
|
n = n % 100;
|
|
|
|
|
dest.push_back((n / 10) + '0');
|
|
|
|
|
dest.push_back((n % 10) + '0');
|
|
|
|
|
dest.push_back(static_cast<char>((n / 10) + '0'));
|
|
|
|
|
dest.push_back(static_cast<char>((n % 10) + '0'));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -86,8 +87,6 @@ inline void pad3(T n, memory_buf_t &dest)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
|
inline void pad6(T n, memory_buf_t &dest)
|
|
|
|
|
{
|
|
|
|
|