Skip to content

Commit

Permalink
🚧 fixing warning C4267 (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Feb 17, 2017
1 parent 057b1e6 commit 0200f2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7046,7 +7046,7 @@ class basic_json
const auto N = j.m_value.string->size();
if (N <= 0x17)
{
v.push_back(0x60 + N); // 1 byte for string + size
v.push_back(0x60 + static_cast<uint8_t>(N)); // 1 byte for string + size
}
else if (N <= 0xff)
{
Expand Down Expand Up @@ -7082,7 +7082,7 @@ class basic_json
const auto N = j.m_value.array->size();
if (N <= 0x17)
{
v.push_back(0x80 + N); // 1 byte for array + size
v.push_back(0x80 + static_cast<uint8_t>(N)); // 1 byte for array + size
}
else if (N <= 0xff)
{
Expand Down Expand Up @@ -7120,7 +7120,7 @@ class basic_json
const auto N = j.m_value.object->size();
if (N <= 0x17)
{
v.push_back(0xa0 + N); // 1 byte for object + size
v.push_back(0xa0 + static_cast<uint8_t>(N)); // 1 byte for object + size
}
else if (N <= 0xff)
{
Expand Down
6 changes: 3 additions & 3 deletions src/json.hpp.re2c
Original file line number Diff line number Diff line change
Expand Up @@ -7046,7 +7046,7 @@ class basic_json
const auto N = j.m_value.string->size();
if (N <= 0x17)
{
v.push_back(0x60 + N); // 1 byte for string + size
v.push_back(0x60 + static_cast<uint8_t>(N)); // 1 byte for string + size
}
else if (N <= 0xff)
{
Expand Down Expand Up @@ -7082,7 +7082,7 @@ class basic_json
const auto N = j.m_value.array->size();
if (N <= 0x17)
{
v.push_back(0x80 + N); // 1 byte for array + size
v.push_back(0x80 + static_cast<uint8_t>(N)); // 1 byte for array + size
}
else if (N <= 0xff)
{
Expand Down Expand Up @@ -7120,7 +7120,7 @@ class basic_json
const auto N = j.m_value.object->size();
if (N <= 0x17)
{
v.push_back(0xa0 + N); // 1 byte for object + size
v.push_back(0xa0 + static_cast<uint8_t>(N)); // 1 byte for object + size
}
else if (N <= 0xff)
{
Expand Down

0 comments on commit 0200f2d

Please sign in to comment.