Skip to content

Commit

Permalink
[upstream_utils] Upgrade to json 3.11.3 (#6807)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jul 7, 2024
1 parent 1c42c1c commit 450fae3
Show file tree
Hide file tree
Showing 51 changed files with 924 additions and 758 deletions.
5 changes: 3 additions & 2 deletions ntcore/src/test/native/cpp/net/WireDecoderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ TEST_F(WireDecodeTextClientTest, ErrorEmpty) {
logger,
Call(_, _, _,
"could not decode JSON message: [json.exception.parse_error.101] "
"parse error at line 1, column 1: syntax error while parsing value "
"- unexpected end of input; expected '[', '{', or a literal"sv));
"parse error at line 1, column 1: attempting to parse an empty "
"input; check that your input string or stream contains the "
"expected JSON"sv));
net::WireDecodeText("", handler, logger);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH 1/4] Remove version from namespace
1 file changed, 3 insertions(+), 42 deletions(-)

diff --git a/include/nlohmann/detail/abi_macros.hpp b/include/nlohmann/detail/abi_macros.hpp
index 0d3108d166602886d41b5f0fec1e56dd3dbe7e3c..ce9291306cdd9a9baeb8fbb77ca1dc33959e0d36 100644
index f48b9eb1d5f0ec15fb47072084a4452f5c39fdde..f333173d73f099b64a60ca7131a0cff7fb6b4521 100644
--- a/include/nlohmann/detail/abi_macros.hpp
+++ b/include/nlohmann/detail/abi_macros.hpp
@@ -42,40 +42,6 @@
Expand Down
6 changes: 3 additions & 3 deletions upstream_utils/json_patches/0002-Make-serializer-public.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Subject: [PATCH 2/4] Make serializer public
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp
index 500fc55ec5e5895ead2b372a6fe79ae941d88d83..7674d134a4d9f230aa4e432294c19dac8dd366b1 100644
index ed20b0d9e183b940d689d712d9e4b2de0b72017e..8bfe47a248d726e929053aa752a25d2fb4022f9b 100644
--- a/include/nlohmann/detail/output/serializer.hpp
+++ b/include/nlohmann/detail/output/serializer.hpp
@@ -373,7 +373,7 @@ class serializer
Expand Down Expand Up @@ -38,10 +38,10 @@ index 500fc55ec5e5895ead2b372a6fe79ae941d88d83..7674d134a4d9f230aa4e432294c19dac
@brief check whether a string is UTF-8 encoded

diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp
index 18a7c875774527a2e08c5ab72e5564aa50381608..c462cade8a7167a00697f6f940be35c5609a283c 100644
index 95d6bf1dd9d8bae1c87db8fb647c734e9c71f327..8ece57d4a0fde54b24fb6985d9b455b12df835ac 100644
--- a/include/nlohmann/json.hpp
+++ b/include/nlohmann/json.hpp
@@ -153,10 +153,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
@@ -157,10 +157,9 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
using binary_reader = ::nlohmann::detail::binary_reader<basic_json, InputType>;
template<typename CharType> using binary_writer = ::nlohmann::detail::binary_writer<basic_json, CharType>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH 3/4] Make dump_escaped() take std::string_view
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp
index 7674d134a4d9f230aa4e432294c19dac8dd366b1..ecc4f7d500b9e0bc15917503061a4db100391366 100644
index 8bfe47a248d726e929053aa752a25d2fb4022f9b..39f0a06d8b5725262866eefe5f22cfc3fad805cd 100644
--- a/include/nlohmann/detail/output/serializer.hpp
+++ b/include/nlohmann/detail/output/serializer.hpp
@@ -388,7 +388,7 @@ class serializer
Expand Down
12 changes: 6 additions & 6 deletions upstream_utils/json_patches/0004-Add-llvm-stream-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Subject: [PATCH 4/4] Add llvm stream support
3 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/include/nlohmann/detail/output/output_adapters.hpp b/include/nlohmann/detail/output/output_adapters.hpp
index 630bd8f73f38b7bf18be571217873f6215e6e31a..78addc557eec3b2a31cde78fb4c6f7f6efc7e777 100644
index 626f7c0c85e35ec51a90baa3bdd12cd8df7ba957..f5f15b241f52cd96a36b885ed10ed7815a0d65ec 100644
--- a/include/nlohmann/detail/output/output_adapters.hpp
+++ b/include/nlohmann/detail/output/output_adapters.hpp
@@ -22,6 +22,8 @@
Expand Down Expand Up @@ -61,7 +61,7 @@ index 630bd8f73f38b7bf18be571217873f6215e6e31a..78addc557eec3b2a31cde78fb4c6f7f6
{
return oa;
diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp
index ecc4f7d500b9e0bc15917503061a4db100391366..bb392a985b57b79020c949593c155052a4271d6b 100644
index 39f0a06d8b5725262866eefe5f22cfc3fad805cd..b5d4906f36702835a44d4fc567966d3064e9cbd1 100644
--- a/include/nlohmann/detail/output/serializer.hpp
+++ b/include/nlohmann/detail/output/serializer.hpp
@@ -65,15 +65,22 @@ class serializer
Expand Down Expand Up @@ -90,10 +90,10 @@ index ecc4f7d500b9e0bc15917503061a4db100391366..bb392a985b57b79020c949593c155052
// delete because of pointer members
serializer(const serializer&) = delete;
diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp
index c462cade8a7167a00697f6f940be35c5609a283c..ad98956ba880f844ed1a17765266880f6ea08b2f 100644
index 8ece57d4a0fde54b24fb6985d9b455b12df835ac..a89e2151e589663ba487a462c3d15cd247ff06cf 100644
--- a/include/nlohmann/json.hpp
+++ b/include/nlohmann/json.hpp
@@ -1275,6 +1275,24 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
@@ -1288,6 +1288,24 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
return result;
}

Expand All @@ -118,7 +118,7 @@ index c462cade8a7167a00697f6f940be35c5609a283c..ad98956ba880f844ed1a17765266880f
/// @brief return the type of the JSON value (explicit)
/// @sa https://json.nlohmann.me/api/basic_json/type/
constexpr value_t type() const noexcept
@@ -3990,6 +4008,12 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
@@ -3998,6 +4016,12 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
return o << j;
}
#endif // JSON_NO_IO
Expand All @@ -130,4 +130,4 @@ index c462cade8a7167a00697f6f940be35c5609a283c..ad98956ba880f844ed1a17765266880f
+ }
/// @}


/////////////////////
2 changes: 1 addition & 1 deletion upstream_utils/update_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


def main():
upstream_root = clone_repo("https://github.com/nlohmann/json", "v3.11.2")
upstream_root = clone_repo("https://github.com/nlohmann/json", "v3.11.3")
wpilib_root = get_repo_root()
wpiutil = os.path.join(wpilib_root, "wpiutil")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT

#pragma once
Expand All @@ -12,15 +12,15 @@

#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
#if defined(WPI_JSON_VERSION_MAJOR) && defined(WPI_JSON_VERSION_MINOR) && defined(WPI_JSON_VERSION_PATCH)
#if WPI_JSON_VERSION_MAJOR != 3 || WPI_JSON_VERSION_MINOR != 11 || WPI_JSON_VERSION_PATCH != 2
#if WPI_JSON_VERSION_MAJOR != 3 || WPI_JSON_VERSION_MINOR != 11 || WPI_JSON_VERSION_PATCH != 3
#warning "Already included a different version of the library!"
#endif
#endif
#endif

#define WPI_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
#define WPI_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
#define WPI_JSON_VERSION_PATCH 2 // NOLINT(modernize-macro-to-enum)
#define WPI_JSON_VERSION_PATCH 3 // NOLINT(modernize-macro-to-enum)

#ifndef JSON_DIAGNOSTICS
#define JSON_DIAGNOSTICS 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT

#pragma once
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// __ _____ _____ _____
// __| | __| | | | JSON for Modern C++
// | | |__ | | | | | | version 3.11.2
// | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json
//
// SPDX-FileCopyrightText: 2009 Florian Loitsch <https://florian.loitsch.com/>
// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT

#pragma once
Expand Down Expand Up @@ -909,7 +909,7 @@ void grisu2(char* buf, int& len, int& decimal_exponent, FloatType value)
// NB: If the neighbors are computed for single-precision numbers, there is a single float
// (7.0385307e-26f) which can't be recovered using strtod. The resulting double precision
// value is off by 1 ulp.
#if 0
#if 0 // NOLINT(readability-avoid-unconditional-preprocessor-if)
const boundaries w = compute_boundaries(static_cast<double>(value));
#else
const boundaries w = compute_boundaries(value);
Expand Down
Loading

0 comments on commit 450fae3

Please sign in to comment.