Skip to content

Commit

Permalink
clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 18, 2024
1 parent ffd9a91 commit c212698
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
6 changes: 3 additions & 3 deletions include/jsoncons/config/compiler_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 4 additions & 7 deletions include/jsoncons/json_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
{
Expand Down Expand Up @@ -2397,7 +2394,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<

void end_negative_value(basic_json_visitor<char_type>& 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)
{
Expand Down
5 changes: 0 additions & 5 deletions test/corelib/src/json_reader_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
// Distributed under Boost license

#include <jsoncons/json.hpp>
#include <jsoncons/json_encoder.hpp>
#include <jsoncons/json_reader.hpp>
#include <catch/catch.hpp>
#include <sstream>
#include <vector>
#include <utility>
#include <ctime>

using namespace jsoncons;

Expand Down

0 comments on commit c212698

Please sign in to comment.