Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
059f21aa
Unverified
Commit
059f21aa
authored
Feb 28, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
💄
fixed a warning
snprintf returns an int, but we later assign it a difference_type which is usually a long.
parent
224f9907
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
json.hpp
src/json.hpp
+1
-1
json.hpp.re2c
src/json.hpp.re2c
+1
-1
No files found.
src/json.hpp
View file @
059f21aa
...
@@ -6684,7 +6684,7 @@ class basic_json
...
@@ -6684,7 +6684,7 @@ class basic_json
static
constexpr
auto
d
=
std
::
numeric_limits
<
number_float_t
>::
digits10
;
static
constexpr
auto
d
=
std
::
numeric_limits
<
number_float_t
>::
digits10
;
// the actual conversion
// the actual conversion
auto
written_bytes
=
snprintf
(
m_buf
.
data
(),
m_buf
.
size
(),
"%.*g"
,
d
,
x
);
long
written_bytes
=
snprintf
(
m_buf
.
data
(),
m_buf
.
size
(),
"%.*g"
,
d
,
x
);
// negative value indicates an error
// negative value indicates an error
assert
(
written_bytes
>
0
);
assert
(
written_bytes
>
0
);
...
...
src/json.hpp.re2c
View file @
059f21aa
...
@@ -6684,7 +6684,7 @@ class basic_json
...
@@ -6684,7 +6684,7 @@ class basic_json
static constexpr auto d = std::numeric_limits<number_float_t>::digits10;
static constexpr auto d = std::numeric_limits<number_float_t>::digits10;
// the actual conversion
// the actual conversion
auto
written_bytes = snprintf(m_buf.data(), m_buf.size(), "%.*g", d, x);
long
written_bytes = snprintf(m_buf.data(), m_buf.size(), "%.*g", d, x);
// negative value indicates an error
// negative value indicates an error
assert(written_bytes > 0);
assert(written_bytes > 0);
...
...
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