diff --git a/include/jsoncons/config/compiler_support.hpp b/include/jsoncons/config/compiler_support.hpp index 5654f6567..22b189153 100644 --- a/include/jsoncons/config/compiler_support.hpp +++ b/include/jsoncons/config/compiler_support.hpp @@ -17,11 +17,11 @@ # if defined(__GNUC_PATCHLEVEL__) # define JSONCONS_GCC_AVAILABLE(major, minor, patch) \ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \ - >= (major * 10000 + minor * 100 + patch)) + >= ((major) * 10000 + (minor) * 100 + (patch))) # else # define JSONCONS_GCC_AVAILABLE(major, minor, patch) \ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) \ - >= (major * 10000 + minor * 100 + patch)) + >= ((major) * 10000 + (minor) * 100 + (patch))) # endif # else # define JSONCONS_GCC_AVAILABLE(major, minor, patch) 0 @@ -30,7 +30,7 @@ #if defined(__clang__) # define JSONCONS_CLANG_AVAILABLE(major, minor, patch) \ ((__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) \ - >= (major * 10000 + minor * 100 + patch)) + >= ((major) * 10000 + (minor) * 100 + (patch))) # else # define JSONCONS_CLANG_AVAILABLE(major, minor, patch) 0 #endif diff --git a/include/jsoncons/json_parser.hpp b/include/jsoncons/json_parser.hpp index b439c5203..aa2eb0488 100644 --- a/include/jsoncons/json_parser.hpp +++ b/include/jsoncons/json_parser.hpp @@ -597,13 +597,10 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input< if (input_ptr_ == input_end_ && more_) { - if (input_ptr_ == input_end_) + chunk_rdr_->read_chunk(*this, ec); + if (ec) { - chunk_rdr_->read_chunk(*this, ec); - if (ec) - { - return; - } + return; } if (input_ptr_ == input_end_) { @@ -2397,7 +2394,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input< void end_negative_value(basic_json_visitor& visitor, std::error_code& ec) { - int64_t val; + int64_t val{}; auto result = jsoncons::detail::to_integer_unchecked(string_buffer_.data(), string_buffer_.length(), val); if (result) { diff --git a/test/corelib/src/json_reader_tests.cpp b/test/corelib/src/json_reader_tests.cpp index 3d5d2cabf..babedb974 100644 --- a/test/corelib/src/json_reader_tests.cpp +++ b/test/corelib/src/json_reader_tests.cpp @@ -2,13 +2,8 @@ // Distributed under Boost license #include -#include #include #include -#include -#include -#include -#include using namespace jsoncons;