🚨 fixed some compiler warnings

This commit is contained in:
Niels Lohmann committed 2018-08-16 18:20:30 +02:00
1 parent d5b21b051c
commit 07494e06d7
7 files changed
+43 -43

No files matched your search

+6 -6
View File
@@ -190,7 +190,7 @@ class json_sax_dom_parser
{
ref_stack.push_back(handle_value(BasicJsonType::value_t::object));
if (JSON_UNLIKELY(len != -1 and len > ref_stack.back()->max_size()))
if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size()))
{
JSON_THROW(out_of_range::create(408,
"excessive object size: " + std::to_string(len)));
@@ -216,7 +216,7 @@ class json_sax_dom_parser
{
ref_stack.push_back(handle_value(BasicJsonType::value_t::array));
if (JSON_UNLIKELY(len != -1 and len > ref_stack.back()->max_size()))
if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size()))
{
JSON_THROW(out_of_range::create(408,
"excessive array size: " + std::to_string(len)));
@@ -373,7 +373,7 @@ class json_sax_dom_callback_parser
// check object limit
if (ref_stack.back())
{
if (JSON_UNLIKELY(len != -1 and len > ref_stack.back()->max_size()))
if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size()))
{
JSON_THROW(out_of_range::create(408,
"excessive object size: " + std::to_string(len)));
@@ -446,7 +446,7 @@ class json_sax_dom_callback_parser
// check array limit
if (ref_stack.back())
{
if (JSON_UNLIKELY(len != -1 and len > ref_stack.back()->max_size()))
if (JSON_UNLIKELY(len != std::size_t(-1) and len > ref_stack.back()->max_size()))
{
JSON_THROW(out_of_range::create(408,
"excessive array size: " + std::to_string(len)));
@@ -649,7 +649,7 @@ class json_sax_acceptor
return true;
}
bool start_object(std::size_t = -1)
bool start_object(std::size_t = std::size_t(-1))
{
return true;
}
@@ -664,7 +664,7 @@ class json_sax_acceptor
return true;
}
bool start_array(std::size_t = -1)
bool start_array(std::size_t = std::size_t(-1))
{
return true;
}