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
447e0142
Commit
447e0142
authored
Dec 12, 2016
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🚨
fixed some warnings
parent
b8776e86
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
src/json.hpp
src/json.hpp
+3
-3
src/json.hpp.re2c
src/json.hpp.re2c
+3
-3
test/src/unit-cbor.cpp
test/src/unit-cbor.cpp
+1
-1
No files found.
src/json.hpp
View file @
447e0142
...
...
@@ -6621,7 +6621,7 @@ class basic_json
// four-byte uint32_t
add_to_vector
(
v
,
4
,
j
.
m_value
.
number_integer
);
}
else
if
(
j
.
m_value
.
number_integer
<=
UINT64_MAX
)
else
{
v
.
push_back
(
0x1b
);
// eight-byte uint64_t
...
...
@@ -6655,7 +6655,7 @@ class basic_json
v
.
push_back
(
0x3a
);
add_to_vector
(
v
,
4
,
positive_number
);
}
else
if
(
positive_number
<=
UINT64_MAX
)
else
{
// int 64
v
.
push_back
(
0x3b
);
...
...
@@ -7186,7 +7186,7 @@ class basic_json
case
0x3b
:
// Negative integer -1-n (eight-byte uint64_t follows)
{
idx
+=
8
;
// skip 8 content bytes
return
static_cast
<
number_integer_t
>
(
-
1
)
-
get_from_vector
<
uint64_t
>
(
v
,
current_idx
);
return
static_cast
<
number_integer_t
>
(
-
1
)
-
static_cast
<
number_integer_t
>
(
get_from_vector
<
uint64_t
>
(
v
,
current_idx
)
);
}
// UTF-8 string (0x00..0x17 bytes follow)
...
...
src/json.hpp.re2c
View file @
447e0142
...
...
@@ -6621,7 +6621,7 @@ class basic_json
// four-byte uint32_t
add_to_vector(v, 4, j.m_value.number_integer);
}
else
if (j.m_value.number_integer <= UINT64_MAX)
else
{
v.push_back(0x1b);
// eight-byte uint64_t
...
...
@@ -6655,7 +6655,7 @@ class basic_json
v.push_back(0x3a);
add_to_vector(v, 4, positive_number);
}
else
if (positive_number <= UINT64_MAX)
else
{
// int 64
v.push_back(0x3b);
...
...
@@ -7186,7 +7186,7 @@ class basic_json
case 0x3b: // Negative integer -1-n (eight-byte uint64_t follows)
{
idx += 8; // skip 8 content bytes
return static_cast<number_integer_t>(-1) -
get_from_vector<uint64_t>(v, current_idx
);
return static_cast<number_integer_t>(-1) -
static_cast<number_integer_t>(get_from_vector<uint64_t>(v, current_idx)
);
}
// UTF-8 string (0x00..0x17 bytes follow)
...
...
test/src/unit-cbor.cpp
View file @
447e0142
...
...
@@ -138,7 +138,7 @@ TEST_CASE("CBOR")
(
static_cast
<
uint64_t
>
(
result
[
7
])
<<
010
)
+
static_cast
<
uint64_t
>
(
result
[
8
]));
CHECK
(
restored
==
positive
);
CHECK
(
-
1
-
restored
==
i
);
CHECK
(
-
1
-
static_cast
<
int64_t
>
(
restored
)
==
i
);
// roundtrip
CHECK
(
json
::
from_cbor
(
result
)
==
j
);
...
...
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