🚨 fixed some compiler warnings

This commit is contained in:
Niels Lohmann 2018-08-16 18:20:30 +02:00
parent d5b21b051c
commit 07494e06d7
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
7 changed files with 43 additions and 43 deletions

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;
}