Skip to content

Commit

Permalink
Merge pull request #1969 from dota17/dota17-warning
Browse files Browse the repository at this point in the history
fix warnings in serializer.hpp for VS2019
  • Loading branch information
nlohmann authored Apr 17, 2020
2 parents 69ac336 + 59cb4c9 commit 3bc9e05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/nlohmann/detail/output/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,9 @@ class serializer
? (byte & 0x3fu) | (codep << 6u)
: (0xFFu >> type) & (byte);

state = utf8d[256u + state * 16u + type];
std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
assert(0 <= index and index < 400);
state = utf8d[index];
return state;
}

Expand Down
4 changes: 3 additions & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15494,7 +15494,9 @@ class serializer
? (byte & 0x3fu) | (codep << 6u)
: (0xFFu >> type) & (byte);

state = utf8d[256u + state * 16u + type];
std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
assert(0 <= index and index < 400);
state = utf8d[index];
return state;
}

Expand Down

0 comments on commit 3bc9e05

Please sign in to comment.