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
0c65ba96
Unverified
Commit
0c65ba96
authored
Mar 13, 2019
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/nlohmann/json
into develop
parents
546e2cbf
c6fc9021
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
7 deletions
+6
-7
include/nlohmann/detail/input/binary_reader.hpp
include/nlohmann/detail/input/binary_reader.hpp
+1
-1
include/nlohmann/detail/output/binary_writer.hpp
include/nlohmann/detail/output/binary_writer.hpp
+1
-1
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+2
-2
test/src/unit-udt.cpp
test/src/unit-udt.cpp
+2
-3
No files found.
include/nlohmann/detail/input/binary_reader.hpp
View file @
0c65ba96
...
...
@@ -1853,7 +1853,7 @@ class binary_reader
}
// reverse byte order prior to conversion if necessary
if
(
is_little_endian
&&
!
InputIsLittleEndian
)
if
(
is_little_endian
!=
InputIsLittleEndian
)
{
vec
[
sizeof
(
NumberType
)
-
i
-
1
]
=
static_cast
<
uint8_t
>
(
current
);
}
...
...
include/nlohmann/detail/output/binary_writer.hpp
View file @
0c65ba96
...
...
@@ -1278,7 +1278,7 @@ class binary_writer
std
::
memcpy
(
vec
.
data
(),
&
n
,
sizeof
(
NumberType
));
// step 2: write array to output (with possible reordering)
if
(
is_little_endian
and
not
OutputIsLittleEndian
)
if
(
is_little_endian
!=
OutputIsLittleEndian
)
{
// reverse byte order prior to conversion if necessary
std
::
reverse
(
vec
.
begin
(),
vec
.
end
());
...
...
single_include/nlohmann/json.hpp
View file @
0c65ba96
...
...
@@ -8334,7 +8334,7 @@ class binary_reader
}
// reverse byte order prior to conversion if necessary
if
(
is_little_endian
&&
!
InputIsLittleEndian
)
if (is_little_endian
!=
InputIsLittleEndian)
{
vec[sizeof(NumberType) - i - 1] = static_cast<uint8_t>(current);
}
...
...
@@ -9747,7 +9747,7 @@ class binary_writer
std::memcpy(vec.data(), &n, sizeof(NumberType));
// step 2: write array to output (with possible reordering)
if
(
is_little_endian
and
not
OutputIsLittleEndian
)
if (is_little_endian
!=
OutputIsLittleEndian)
{
// reverse byte order prior to conversion if necessary
std::reverse(vec.begin(), vec.end());
...
...
test/src/unit-udt.cpp
View file @
0c65ba96
...
...
@@ -599,9 +599,8 @@ struct pod_serializer
static
void
to_json
(
BasicJsonType
&
j
,
const
T
&
t
)
noexcept
{
auto
bytes
=
static_cast
<
const
unsigned
char
*>
(
static_cast
<
const
void
*>
(
&
t
));
std
::
uint64_t
value
=
bytes
[
0
];
for
(
auto
i
=
1
;
i
<
8
;
++
i
)
value
|=
std
::
uint64_t
{
bytes
[
i
]}
<<
8
*
i
;
std
::
uint64_t
value
;
std
::
memcpy
(
&
value
,
bytes
,
sizeof
(
value
));
nlohmann
::
to_json
(
j
,
value
);
}
};
...
...
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