Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #4160

Merged
merged 6 commits into from
Sep 23, 2023
Merged

Fix CI #4160

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ Checks: '*,
-misc-non-private-member-variables-in-classes,
-modernize-concat-nested-namespaces,
-modernize-type-traits,
-modernize-use-constraints,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-enum-size,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
Expand Down
2 changes: 1 addition & 1 deletion include/nlohmann/detail/input/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class lexer : public lexer_base<BasicJsonType>
for (auto range = ranges.begin(); range != ranges.end(); ++range)
{
get();
if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range)))
if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range))) // NOLINT(bugprone-inc-dec-in-conditions)
{
add(current);
}
Expand Down
44 changes: 43 additions & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
// SPDX-License-Identifier: MIT



#include <utility>

// #include <nlohmann/detail/abi_macros.hpp>
Expand All @@ -53,6 +54,7 @@
// SPDX-License-Identifier: MIT



// This file contains all macro definitions affecting or depending on the ABI

#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
Expand Down Expand Up @@ -154,6 +156,7 @@
// SPDX-License-Identifier: MIT



#include <algorithm> // transform
#include <array> // array
#include <forward_list> // forward_list
Expand All @@ -176,6 +179,7 @@
// SPDX-License-Identifier: MIT



#include <cstddef> // nullptr_t
#include <exception> // exception
#if JSON_DIAGNOSTICS
Expand All @@ -195,6 +199,7 @@
// SPDX-License-Identifier: MIT



#include <array> // array
#include <cstddef> // size_t
#include <cstdint> // uint8_t
Expand All @@ -210,6 +215,7 @@
// SPDX-License-Identifier: MIT



#include <utility> // declval, pair
// #include <nlohmann/detail/meta/detected.hpp>
// __ _____ _____ _____
Expand All @@ -221,6 +227,7 @@
// SPDX-License-Identifier: MIT



#include <type_traits>

// #include <nlohmann/detail/meta/void_t.hpp>
Expand All @@ -233,6 +240,7 @@
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/abi_macros.hpp>


Expand Down Expand Up @@ -2924,6 +2932,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/abi_macros.hpp>


Expand Down Expand Up @@ -2998,6 +3007,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstddef> // size_t

// #include <nlohmann/detail/abi_macros.hpp>
Expand Down Expand Up @@ -3040,6 +3050,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <array> // array
#include <cstddef> // size_t
#include <type_traits> // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type
Expand Down Expand Up @@ -3212,6 +3223,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <limits> // numeric_limits
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
#include <utility> // declval
Expand All @@ -3227,6 +3239,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <iterator> // random_access_iterator_tag

// #include <nlohmann/detail/abi_macros.hpp>
Expand Down Expand Up @@ -3294,6 +3307,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/macro_scope.hpp>


Expand All @@ -3313,6 +3327,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/macro_scope.hpp>


Expand Down Expand Up @@ -4130,6 +4145,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstring> // strlen
#include <string> // string
#include <utility> // forward
Expand Down Expand Up @@ -4515,6 +4531,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/abi_macros.hpp>


Expand All @@ -4538,6 +4555,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/macro_scope.hpp>


Expand Down Expand Up @@ -5043,6 +5061,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <algorithm> // copy
#include <iterator> // begin, end
#include <string> // string
Expand All @@ -5062,6 +5081,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstddef> // size_t
#include <iterator> // input_iterator_tag
#include <string> // string, to_string
Expand Down Expand Up @@ -5782,6 +5802,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstdint> // uint8_t, uint64_t
#include <tuple> // tie
#include <utility> // move
Expand Down Expand Up @@ -5893,6 +5914,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstdint> // uint8_t
#include <cstddef> // size_t
#include <functional> // hash
Expand Down Expand Up @@ -6025,6 +6047,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <algorithm> // generate_n
#include <array> // array
#include <cmath> // ldexp
Expand All @@ -6050,6 +6073,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <array> // array
#include <cstddef> // size_t
#include <cstring> // strlen
Expand Down Expand Up @@ -6544,6 +6568,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstddef>
#include <string> // string
#include <utility> // move
Expand Down Expand Up @@ -7275,6 +7300,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <array> // array
#include <clocale> // localeconv
#include <cstddef> // size_t
Expand Down Expand Up @@ -7492,7 +7518,7 @@ class lexer : public lexer_base<BasicJsonType>
for (auto range = ranges.begin(); range != ranges.end(); ++range)
{
get();
if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range)))
if (JSON_HEDLEY_LIKELY(*range <= current && current <= *(++range))) // NOLINT(bugprone-inc-dec-in-conditions)
{
add(current);
}
Expand Down Expand Up @@ -8913,6 +8939,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstdint> // size_t
#include <utility> // declval
#include <string> // string
Expand Down Expand Up @@ -12064,6 +12091,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cmath> // isfinite
#include <cstdint> // uint8_t
#include <functional> // function
Expand Down Expand Up @@ -12580,6 +12608,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



// #include <nlohmann/detail/abi_macros.hpp>

// #include <nlohmann/detail/iterators/primitive_iterator.hpp>
Expand All @@ -12592,6 +12621,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstddef> // ptrdiff_t
#include <limits> // numeric_limits

Expand Down Expand Up @@ -12750,6 +12780,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <iterator> // iterator, random_access_iterator_tag, bidirectional_iterator_tag, advance, next
#include <type_traits> // conditional, is_const, remove_const

Expand Down Expand Up @@ -13511,6 +13542,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <cstddef> // ptrdiff_t
#include <iterator> // reverse_iterator
#include <utility> // declval
Expand Down Expand Up @@ -13679,6 +13711,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <algorithm> // all_of
#include <cctype> // isdigit
#include <cerrno> // errno, ERANGE
Expand Down Expand Up @@ -14673,6 +14706,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <initializer_list>
#include <utility>

Expand Down Expand Up @@ -14764,6 +14798,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <algorithm> // reverse
#include <array> // array
#include <map> // map
Expand All @@ -14789,6 +14824,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <algorithm> // copy
#include <cstddef> // size_t
#include <iterator> // back_inserter
Expand Down Expand Up @@ -16757,6 +16793,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <algorithm> // reverse, remove, fill, find, none_of
#include <array> // array
#include <clocale> // localeconv, lconv
Expand All @@ -16781,6 +16818,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <array> // array
#include <cmath> // signbit, isfinite
#include <cstdint> // intN_t, uintN_t
Expand Down Expand Up @@ -18875,6 +18913,7 @@ NLOHMANN_JSON_NAMESPACE_END
// SPDX-License-Identifier: MIT



#include <functional> // equal_to, less
#include <initializer_list> // initializer_list
#include <iterator> // input_iterator_tag, iterator_traits
Expand Down Expand Up @@ -24412,6 +24451,7 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
// SPDX-License-Identifier: MIT



// restore clang diagnostic settings
#if defined(__clang__)
#pragma clang diagnostic pop
Expand Down Expand Up @@ -24455,6 +24495,7 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
// SPDX-License-Identifier: MIT



#undef JSON_HEDLEY_ALWAYS_INLINE
#undef JSON_HEDLEY_ARM_VERSION
#undef JSON_HEDLEY_ARM_VERSION_CHECK
Expand Down Expand Up @@ -24605,4 +24646,5 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
#undef JSON_HEDLEY_FALL_THROUGH



#endif // INCLUDE_NLOHMANN_JSON_HPP_
3 changes: 3 additions & 0 deletions single_include/nlohmann/json_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT



// This file contains all macro definitions affecting or depending on the ABI

#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
Expand Down Expand Up @@ -115,6 +117,7 @@
} // namespace nlohmann
#endif


/*!
@brief namespace for Niels Lohmann
@see https://github.com/nlohmann
Expand Down
2 changes: 1 addition & 1 deletion tests/src/fuzzer-parse_bjdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
// step 2.1: round trip without adding size annotations to container types
std::vector<uint8_t> const vec2 = json::to_bjdata(j1, false, false);

// step 2.2: round trip with adding size annotations but without adding type annonations to container types
// step 2.2: round trip with adding size annotations but without adding type annotations to container types
std::vector<uint8_t> const vec3 = json::to_bjdata(j1, true, false);

// step 2.3: round trip with adding size as well as type annotations to container types
Expand Down
2 changes: 1 addition & 1 deletion tests/src/fuzzer-parse_ubjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
// step 2.1: round trip without adding size annotations to container types
std::vector<uint8_t> const vec2 = json::to_ubjson(j1, false, false);

// step 2.2: round trip with adding size annotations but without adding type annonations to container types
// step 2.2: round trip with adding size annotations but without adding type annotations to container types
std::vector<uint8_t> const vec3 = json::to_ubjson(j1, true, false);

// step 2.3: round trip with adding size as well as type annotations to container types
Expand Down
Loading