Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
5c38e76c
Unverified
Commit
5c38e76c
authored
3 years ago
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/nlohmann/json
into issue2863
parents
7c19aa22
359f6723
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
18 additions
and
6 deletions
+18
-6
include/nlohmann/detail/conversions/to_chars.hpp
include/nlohmann/detail/conversions/to_chars.hpp
+3
-0
include/nlohmann/detail/output/binary_writer.hpp
include/nlohmann/detail/output/binary_writer.hpp
+3
-0
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+3
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+9
-0
test/src/unit-cbor.cpp
test/src/unit-cbor.cpp
+0
-1
test/src/unit-constructor1.cpp
test/src/unit-constructor1.cpp
+0
-1
test/src/unit-readme.cpp
test/src/unit-readme.cpp
+0
-1
test/src/unit-reference_access.cpp
test/src/unit-reference_access.cpp
+0
-1
test/src/unit-regression1.cpp
test/src/unit-regression1.cpp
+0
-1
test/src/unit-regression2.cpp
test/src/unit-regression2.cpp
+0
-1
No files found.
include/nlohmann/detail/conversions/to_chars.hpp
View file @
5c38e76c
...
@@ -1066,6 +1066,8 @@ char* to_chars(char* first, const char* last, FloatType value)
...
@@ -1066,6 +1066,8 @@ char* to_chars(char* first, const char* last, FloatType value)
*
first
++
=
'-'
;
*
first
++
=
'-'
;
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if
(
value
==
0
)
// +-0
if
(
value
==
0
)
// +-0
{
{
*
first
++
=
'0'
;
*
first
++
=
'0'
;
...
@@ -1074,6 +1076,7 @@ char* to_chars(char* first, const char* last, FloatType value)
...
@@ -1074,6 +1076,7 @@ char* to_chars(char* first, const char* last, FloatType value)
*
first
++
=
'0'
;
*
first
++
=
'0'
;
return
first
;
return
first
;
}
}
#pragma GCC diagnostic pop
JSON_ASSERT
(
last
-
first
>=
std
::
numeric_limits
<
FloatType
>::
max_digits10
);
JSON_ASSERT
(
last
-
first
>=
std
::
numeric_limits
<
FloatType
>::
max_digits10
);
...
...
This diff is collapsed.
Click to expand it.
include/nlohmann/detail/output/binary_writer.hpp
View file @
5c38e76c
...
@@ -1524,6 +1524,8 @@ class binary_writer
...
@@ -1524,6 +1524,8 @@ class binary_writer
void
write_compact_float
(
const
number_float_t
n
,
detail
::
input_format_t
format
)
void
write_compact_float
(
const
number_float_t
n
,
detail
::
input_format_t
format
)
{
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if
(
static_cast
<
double
>
(
n
)
>=
static_cast
<
double
>
(
std
::
numeric_limits
<
float
>::
lowest
())
&&
if
(
static_cast
<
double
>
(
n
)
>=
static_cast
<
double
>
(
std
::
numeric_limits
<
float
>::
lowest
())
&&
static_cast
<
double
>
(
n
)
<=
static_cast
<
double
>
((
std
::
numeric_limits
<
float
>::
max
)())
&&
static_cast
<
double
>
(
n
)
<=
static_cast
<
double
>
((
std
::
numeric_limits
<
float
>::
max
)())
&&
static_cast
<
double
>
(
static_cast
<
float
>
(
n
))
==
static_cast
<
double
>
(
n
))
static_cast
<
double
>
(
static_cast
<
float
>
(
n
))
==
static_cast
<
double
>
(
n
))
...
@@ -1540,6 +1542,7 @@ class binary_writer
...
@@ -1540,6 +1542,7 @@ class binary_writer
:
get_msgpack_float_prefix
(
n
));
:
get_msgpack_float_prefix
(
n
));
write_number
(
n
);
write_number
(
n
);
}
}
#pragma GCC diagnostic pop
}
}
public:
public:
...
...
This diff is collapsed.
Click to expand it.
include/nlohmann/json.hpp
View file @
5c38e76c
...
@@ -6278,6 +6278,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
...
@@ -6278,6 +6278,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
*/
*/
friend
bool
operator
==
(
const_reference
lhs
,
const_reference
rhs
)
noexcept
friend
bool
operator
==
(
const_reference
lhs
,
const_reference
rhs
)
noexcept
{
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
const
auto
lhs_type
=
lhs
.
type
();
const
auto
lhs_type
=
lhs
.
type
();
const
auto
rhs_type
=
rhs
.
type
();
const
auto
rhs_type
=
rhs
.
type
();
...
@@ -6342,6 +6344,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
...
@@ -6342,6 +6344,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
}
return
false
;
return
false
;
#pragma GCC diagnostic pop
}
}
/*!
/*!
...
...
This diff is collapsed.
Click to expand it.
single_include/nlohmann/json.hpp
View file @
5c38e76c
...
@@ -14827,6 +14827,8 @@ class binary_writer
...
@@ -14827,6 +14827,8 @@ class binary_writer
void write_compact_float(const number_float_t n, detail::input_format_t format)
void write_compact_float(const number_float_t n, detail::input_format_t format)
{
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if (static_cast<double>(n) >= static_cast<double>(std::numeric_limits<float>::lowest()) &&
if (static_cast<double>(n) >= static_cast<double>(std::numeric_limits<float>::lowest()) &&
static_cast<double>(n) <= static_cast<double>((std::numeric_limits<float>::max)()) &&
static_cast<double>(n) <= static_cast<double>((std::numeric_limits<float>::max)()) &&
static_cast<double>(static_cast<float>(n)) == static_cast<double>(n))
static_cast<double>(static_cast<float>(n)) == static_cast<double>(n))
...
@@ -14843,6 +14845,7 @@ class binary_writer
...
@@ -14843,6 +14845,7 @@ class binary_writer
: get_msgpack_float_prefix(n));
: get_msgpack_float_prefix(n));
write_number(n);
write_number(n);
}
}
#pragma GCC diagnostic pop
}
}
public:
public:
...
@@ -15983,6 +15986,8 @@ char* to_chars(char* first, const char* last, FloatType value)
...
@@ -15983,6 +15986,8 @@ char* to_chars(char* first, const char* last, FloatType value)
*first++ = '-';
*first++ = '-';
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if (value == 0) // +-0
if (value == 0) // +-0
{
{
*first++ = '0';
*first++ = '0';
...
@@ -15991,6 +15996,7 @@ char* to_chars(char* first, const char* last, FloatType value)
...
@@ -15991,6 +15996,7 @@ char* to_chars(char* first, const char* last, FloatType value)
*first++ = '0';
*first++ = '0';
return first;
return first;
}
}
#pragma GCC diagnostic pop
JSON_ASSERT(last - first >= std::numeric_limits<FloatType>::max_digits10);
JSON_ASSERT(last - first >= std::numeric_limits<FloatType>::max_digits10);
...
@@ -23365,6 +23371,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
...
@@ -23365,6 +23371,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
*/
*/
friend bool operator==(const_reference lhs, const_reference rhs) noexcept
friend bool operator==(const_reference lhs, const_reference rhs) noexcept
{
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
const auto lhs_type = lhs.type();
const auto lhs_type = lhs.type();
const auto rhs_type = rhs.type();
const auto rhs_type = rhs.type();
...
@@ -23429,6 +23437,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
...
@@ -23429,6 +23437,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
}
}
return false;
return false;
#pragma GCC diagnostic pop
}
}
/*!
/*!
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-cbor.cpp
View file @
5c38e76c
...
@@ -28,7 +28,6 @@ SOFTWARE.
...
@@ -28,7 +28,6 @@ SOFTWARE.
*/
*/
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
DOCTEST_GCC_SUPPRESS_WARNING
(
"-Wfloat-equal"
)
#include <nlohmann/json.hpp>
#include <nlohmann/json.hpp>
using
nlohmann
::
json
;
using
nlohmann
::
json
;
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-constructor1.cpp
View file @
5c38e76c
...
@@ -28,7 +28,6 @@ SOFTWARE.
...
@@ -28,7 +28,6 @@ SOFTWARE.
*/
*/
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
DOCTEST_GCC_SUPPRESS_WARNING
(
"-Wfloat-equal"
)
#define JSON_TESTS_PRIVATE
#define JSON_TESTS_PRIVATE
#include <nlohmann/json.hpp>
#include <nlohmann/json.hpp>
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-readme.cpp
View file @
5c38e76c
...
@@ -28,7 +28,6 @@ SOFTWARE.
...
@@ -28,7 +28,6 @@ SOFTWARE.
*/
*/
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
DOCTEST_GCC_SUPPRESS_WARNING
(
"-Wfloat-equal"
)
#include <nlohmann/json.hpp>
#include <nlohmann/json.hpp>
using
nlohmann
::
json
;
using
nlohmann
::
json
;
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-reference_access.cpp
View file @
5c38e76c
...
@@ -28,7 +28,6 @@ SOFTWARE.
...
@@ -28,7 +28,6 @@ SOFTWARE.
*/
*/
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
DOCTEST_GCC_SUPPRESS_WARNING
(
"-Wfloat-equal"
)
#include <nlohmann/json.hpp>
#include <nlohmann/json.hpp>
using
nlohmann
::
json
;
using
nlohmann
::
json
;
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-regression1.cpp
View file @
5c38e76c
...
@@ -28,7 +28,6 @@ SOFTWARE.
...
@@ -28,7 +28,6 @@ SOFTWARE.
*/
*/
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
DOCTEST_GCC_SUPPRESS_WARNING
(
"-Wfloat-equal"
)
// for some reason including this after the json header leads to linker errors with VS 2017...
// for some reason including this after the json header leads to linker errors with VS 2017...
#include <locale>
#include <locale>
...
...
This diff is collapsed.
Click to expand it.
test/src/unit-regression2.cpp
View file @
5c38e76c
...
@@ -28,7 +28,6 @@ SOFTWARE.
...
@@ -28,7 +28,6 @@ SOFTWARE.
*/
*/
#include "doctest_compatibility.h"
#include "doctest_compatibility.h"
DOCTEST_GCC_SUPPRESS_WARNING
(
"-Wfloat-equal"
)
// for some reason including this after the json header leads to linker errors with VS 2017...
// for some reason including this after the json header leads to linker errors with VS 2017...
#include <locale>
#include <locale>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment