Merge pull request #2051 from nlohmann/clang10warnings
Fix Clang compiler warnings
This commit is contained in:
commit
721a1a0b5d
4 changed files with 7 additions and 9 deletions
|
@ -1006,7 +1006,7 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
|
||||||
|
|
||||||
std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n, static_cast<size_t>(k) - static_cast<size_t>(n));
|
std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n, static_cast<size_t>(k) - static_cast<size_t>(n));
|
||||||
buf[n] = '.';
|
buf[n] = '.';
|
||||||
return buf + (static_cast<size_t>(k) + 1);
|
return buf + (static_cast<size_t>(k) + 1U);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (min_exp < n and n <= 0)
|
if (min_exp < n and n <= 0)
|
||||||
|
@ -1018,7 +1018,7 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
|
||||||
buf[0] = '0';
|
buf[0] = '0';
|
||||||
buf[1] = '.';
|
buf[1] = '.';
|
||||||
std::memset(buf + 2, '0', static_cast<size_t>(-n));
|
std::memset(buf + 2, '0', static_cast<size_t>(-n));
|
||||||
return buf + (2 + static_cast<size_t>(-n) + k);
|
return buf + (2U + static_cast<size_t>(-n) + static_cast<size_t>(k));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == 1)
|
if (k == 1)
|
||||||
|
|
|
@ -259,8 +259,7 @@ class serializer
|
||||||
{
|
{
|
||||||
dump_integer(*i);
|
dump_integer(*i);
|
||||||
o->write_character(',');
|
o->write_character(',');
|
||||||
int index = i - val.m_value.binary->cbegin();
|
if (std::distance(val.m_value.binary->cbegin(), i) % 16 == 0)
|
||||||
if (index % 16 == 0)
|
|
||||||
{
|
{
|
||||||
o->write_character('\n');
|
o->write_character('\n');
|
||||||
}
|
}
|
||||||
|
|
|
@ -14543,7 +14543,7 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
|
||||||
|
|
||||||
std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n, static_cast<size_t>(k) - static_cast<size_t>(n));
|
std::memmove(buf + (static_cast<size_t>(n) + 1), buf + n, static_cast<size_t>(k) - static_cast<size_t>(n));
|
||||||
buf[n] = '.';
|
buf[n] = '.';
|
||||||
return buf + (static_cast<size_t>(k) + 1);
|
return buf + (static_cast<size_t>(k) + 1U);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (min_exp < n and n <= 0)
|
if (min_exp < n and n <= 0)
|
||||||
|
@ -14555,7 +14555,7 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
|
||||||
buf[0] = '0';
|
buf[0] = '0';
|
||||||
buf[1] = '.';
|
buf[1] = '.';
|
||||||
std::memset(buf + 2, '0', static_cast<size_t>(-n));
|
std::memset(buf + 2, '0', static_cast<size_t>(-n));
|
||||||
return buf + (2 + static_cast<size_t>(-n) + k);
|
return buf + (2U + static_cast<size_t>(-n) + static_cast<size_t>(k));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (k == 1)
|
if (k == 1)
|
||||||
|
@ -14892,8 +14892,7 @@ class serializer
|
||||||
{
|
{
|
||||||
dump_integer(*i);
|
dump_integer(*i);
|
||||||
o->write_character(',');
|
o->write_character(',');
|
||||||
int index = i - val.m_value.binary->cbegin();
|
if (std::distance(val.m_value.binary->cbegin(), i) % 16 == 0)
|
||||||
if (index % 16 == 0)
|
|
||||||
{
|
{
|
||||||
o->write_character('\n');
|
o->write_character('\n');
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ struct SaxEventLogger : public nlohmann::json_sax<json>
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool binary(std::vector<std::uint8_t>& val)
|
bool binary(std::vector<std::uint8_t>& val) override
|
||||||
{
|
{
|
||||||
std::string binary_contents = "binary(";
|
std::string binary_contents = "binary(";
|
||||||
std::string comma_space = "";
|
std::string comma_space = "";
|
||||||
|
|
Loading…
Reference in a new issue