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
66dd1a84
Unverified
Commit
66dd1a84
authored
7 years ago
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed more compiler warnings
parent
85092226
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
12 deletions
+8
-12
include/nlohmann/detail/conversions/to_json.hpp
include/nlohmann/detail/conversions/to_json.hpp
+1
-1
include/nlohmann/detail/input/json_sax.hpp
include/nlohmann/detail/input/json_sax.hpp
+1
-3
include/nlohmann/detail/input/lexer.hpp
include/nlohmann/detail/input/lexer.hpp
+1
-1
include/nlohmann/detail/iterators/primitive_iterator.hpp
include/nlohmann/detail/iterators/primitive_iterator.hpp
+2
-2
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+3
-5
No files found.
include/nlohmann/detail/conversions/to_json.hpp
View file @
66dd1a84
...
@@ -247,7 +247,7 @@ void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
...
@@ -247,7 +247,7 @@ void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
template
<
typename
BasicJsonType
,
typename
T
,
template
<
typename
BasicJsonType
,
typename
T
,
enable_if_t
<
std
::
is_convertible
<
T
,
BasicJsonType
>
::
value
,
int
>
=
0
>
enable_if_t
<
std
::
is_convertible
<
T
,
BasicJsonType
>
::
value
,
int
>
=
0
>
void
to_json
(
BasicJsonType
&
j
,
std
::
valarray
<
T
>
arr
)
void
to_json
(
BasicJsonType
&
j
,
const
std
::
valarray
<
T
>&
arr
)
{
{
external_constructor
<
value_t
::
array
>::
construct
(
j
,
std
::
move
(
arr
));
external_constructor
<
value_t
::
array
>::
construct
(
j
,
std
::
move
(
arr
));
}
}
...
...
This diff is collapsed.
Click to expand it.
include/nlohmann/detail/input/json_sax.hpp
View file @
66dd1a84
...
@@ -405,11 +405,9 @@ class json_sax_dom_callback_parser : public json_sax<BasicJsonType>
...
@@ -405,11 +405,9 @@ class json_sax_dom_callback_parser : public json_sax<BasicJsonType>
bool
end_object
()
override
bool
end_object
()
override
{
{
bool
keep
=
true
;
if
(
ref_stack
.
back
())
if
(
ref_stack
.
back
())
{
{
keep
=
callback
(
static_cast
<
int
>
(
ref_stack
.
size
())
-
1
,
parse_event_t
::
object_end
,
*
ref_stack
.
back
());
if
(
not
callback
(
static_cast
<
int
>
(
ref_stack
.
size
())
-
1
,
parse_event_t
::
object_end
,
*
ref_stack
.
back
()))
if
(
not
keep
)
{
{
// discard object
// discard object
*
ref_stack
.
back
()
=
discarded
;
*
ref_stack
.
back
()
=
discarded
;
...
...
This diff is collapsed.
Click to expand it.
include/nlohmann/detail/input/lexer.hpp
View file @
66dd1a84
...
@@ -1173,7 +1173,7 @@ scan_number_done:
...
@@ -1173,7 +1173,7 @@ scan_number_done:
{
{
// escape control characters
// escape control characters
char
cs
[
9
];
char
cs
[
9
];
snprintf
(
cs
,
9
,
"<U+%.4hhX>"
,
c
);
snprintf
(
cs
,
9
,
"<U+%.4hhX>"
,
static_cast
<
unsigned
char
>
(
c
)
);
result
+=
cs
;
result
+=
cs
;
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
include/nlohmann/detail/iterators/primitive_iterator.hpp
View file @
66dd1a84
...
@@ -87,7 +87,7 @@ class primitive_iterator_t
...
@@ -87,7 +87,7 @@ class primitive_iterator_t
primitive_iterator_t
const
operator
++
(
int
)
noexcept
primitive_iterator_t
const
operator
++
(
int
)
noexcept
{
{
auto
result
=
*
this
;
auto
result
=
*
this
;
m_it
++
;
++
m_it
;
return
result
;
return
result
;
}
}
...
@@ -100,7 +100,7 @@ class primitive_iterator_t
...
@@ -100,7 +100,7 @@ class primitive_iterator_t
primitive_iterator_t
const
operator
--
(
int
)
noexcept
primitive_iterator_t
const
operator
--
(
int
)
noexcept
{
{
auto
result
=
*
this
;
auto
result
=
*
this
;
m_it
--
;
--
m_it
;
return
result
;
return
result
;
}
}
...
...
This diff is collapsed.
Click to expand it.
single_include/nlohmann/json.hpp
View file @
66dd1a84
...
@@ -1520,7 +1520,7 @@ void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
...
@@ -1520,7 +1520,7 @@ void to_json(BasicJsonType& j, const CompatibleArrayType& arr)
template
<
typename
BasicJsonType
,
typename
T
,
template
<
typename
BasicJsonType
,
typename
T
,
enable_if_t
<
std
::
is_convertible
<
T
,
BasicJsonType
>
::
value
,
int
>
=
0
>
enable_if_t
<
std
::
is_convertible
<
T
,
BasicJsonType
>
::
value
,
int
>
=
0
>
void
to_json
(
BasicJsonType
&
j
,
std
::
valarray
<
T
>
arr
)
void
to_json
(
BasicJsonType
&
j
,
const
std
::
valarray
<
T
>&
arr
)
{
{
external_constructor
<
value_t
::
array
>::
construct
(
j
,
std
::
move
(
arr
));
external_constructor
<
value_t
::
array
>::
construct
(
j
,
std
::
move
(
arr
));
}
}
...
@@ -3165,7 +3165,7 @@ scan_number_done:
...
@@ -3165,7 +3165,7 @@ scan_number_done:
{
{
// escape control characters
// escape control characters
char
cs
[
9
];
char
cs
[
9
];
snprintf
(
cs
,
9
,
"<U+%.4hhX>"
,
c
);
snprintf
(
cs
,
9
,
"<U+%.4hhX>"
,
static_cast
<
unsigned
char
>
(
c
)
);
result
+=
cs
;
result
+=
cs
;
}
}
else
else
...
@@ -3746,11 +3746,9 @@ class json_sax_dom_callback_parser : public json_sax<BasicJsonType>
...
@@ -3746,11 +3746,9 @@ class json_sax_dom_callback_parser : public json_sax<BasicJsonType>
bool
end_object
()
override
bool
end_object
()
override
{
{
bool
keep
=
true
;
if
(
ref_stack
.
back
())
if
(
ref_stack
.
back
())
{
{
keep
=
callback
(
static_cast
<
int
>
(
ref_stack
.
size
())
-
1
,
parse_event_t
::
object_end
,
*
ref_stack
.
back
());
if
(
not
callback
(
static_cast
<
int
>
(
ref_stack
.
size
())
-
1
,
parse_event_t
::
object_end
,
*
ref_stack
.
back
()))
if
(
not
keep
)
{
{
// discard object
// discard object
*
ref_stack
.
back
()
=
discarded
;
*
ref_stack
.
back
()
=
discarded
;
...
...
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