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
69ac3360
Unverified
Commit
69ac3360
authored
Apr 17, 2020
by
Niels Lohmann
Committed by
GitHub
Apr 17, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1967 from dota17/dota17-disable
Fix C26451 warnnings in to_chars.hpp
parents
f2b43a36
0a821689
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
include/nlohmann/detail/conversions/to_chars.hpp
include/nlohmann/detail/conversions/to_chars.hpp
+8
-8
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+8
-8
No files found.
include/nlohmann/detail/conversions/to_chars.hpp
View file @
69ac3360
...
@@ -990,11 +990,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -990,11 +990,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
// digits[000]
// digits[000]
// len <= max_exp + 2
// len <= max_exp + 2
std
::
memset
(
buf
+
k
,
'0'
,
static_cast
<
size_t
>
(
n
-
k
));
std
::
memset
(
buf
+
k
,
'0'
,
static_cast
<
size_t
>
(
n
)
-
static_cast
<
size_t
>
(
k
));
// Make it look like a floating-point number (#362, #378)
// Make it look like a floating-point number (#362, #378)
buf
[
n
+
0
]
=
'.'
;
buf
[
n
+
0
]
=
'.'
;
buf
[
n
+
1
]
=
'0'
;
buf
[
n
+
1
]
=
'0'
;
return
buf
+
(
n
+
2
);
return
buf
+
(
static_cast
<
size_t
>
(
n
)
+
2
);
}
}
if
(
0
<
n
and
n
<=
max_exp
)
if
(
0
<
n
and
n
<=
max_exp
)
...
@@ -1004,9 +1004,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -1004,9 +1004,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
assert
(
k
>
n
);
assert
(
k
>
n
);
std
::
memmove
(
buf
+
(
n
+
1
),
buf
+
n
,
static_cast
<
size_t
>
(
k
-
n
));
std
::
memmove
(
buf
+
(
static_cast
<
size_t
>
(
n
)
+
1
),
buf
+
n
,
static_cast
<
size_t
>
(
k
)
-
static_cast
<
size_t
>
(
n
));
buf
[
n
]
=
'.'
;
buf
[
n
]
=
'.'
;
return
buf
+
(
k
+
1
);
return
buf
+
(
static_cast
<
size_t
>
(
k
)
+
1
);
}
}
if
(
min_exp
<
n
and
n
<=
0
)
if
(
min_exp
<
n
and
n
<=
0
)
...
@@ -1014,11 +1014,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -1014,11 +1014,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
// 0.[000]digits
// 0.[000]digits
// len <= 2 + (-min_exp - 1) + max_digits10
// len <= 2 + (-min_exp - 1) + max_digits10
std
::
memmove
(
buf
+
(
2
+
-
n
),
buf
,
static_cast
<
size_t
>
(
k
));
std
::
memmove
(
buf
+
(
2
+
static_cast
<
size_t
>
(
-
n
)
),
buf
,
static_cast
<
size_t
>
(
k
));
buf
[
0
]
=
'0'
;
buf
[
0
]
=
'0'
;
buf
[
1
]
=
'.'
;
buf
[
1
]
=
'.'
;
std
::
memset
(
buf
+
2
,
'0'
,
static_cast
<
size_t
>
(
-
n
));
std
::
memset
(
buf
+
2
,
'0'
,
static_cast
<
size_t
>
(
-
n
));
return
buf
+
(
2
+
(
-
n
)
+
k
);
return
buf
+
(
2
+
static_cast
<
size_t
>
(
-
n
)
+
k
);
}
}
if
(
k
==
1
)
if
(
k
==
1
)
...
@@ -1033,9 +1033,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -1033,9 +1033,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
// d.igitsE+123
// d.igitsE+123
// len <= max_digits10 + 1 + 5
// len <= max_digits10 + 1 + 5
std
::
memmove
(
buf
+
2
,
buf
+
1
,
static_cast
<
size_t
>
(
k
-
1
)
);
std
::
memmove
(
buf
+
2
,
buf
+
1
,
static_cast
<
size_t
>
(
k
)
-
1
);
buf
[
1
]
=
'.'
;
buf
[
1
]
=
'.'
;
buf
+=
1
+
k
;
buf
+=
1
+
static_cast
<
size_t
>
(
k
)
;
}
}
*
buf
++
=
'e'
;
*
buf
++
=
'e'
;
...
...
single_include/nlohmann/json.hpp
View file @
69ac3360
...
@@ -14527,11 +14527,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -14527,11 +14527,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
// digits[000]
// digits[000]
// len <= max_exp + 2
// len <= max_exp + 2
std
::
memset
(
buf
+
k
,
'0'
,
static_cast
<
size_t
>
(
n
-
k
));
std
::
memset
(
buf
+
k
,
'0'
,
static_cast
<
size_t
>
(
n
)
-
static_cast
<
size_t
>
(
k
));
// Make it look like a floating-point number (#362, #378)
// Make it look like a floating-point number (#362, #378)
buf
[
n
+
0
]
=
'.'
;
buf
[
n
+
0
]
=
'.'
;
buf
[
n
+
1
]
=
'0'
;
buf
[
n
+
1
]
=
'0'
;
return
buf
+
(
n
+
2
);
return
buf
+
(
static_cast
<
size_t
>
(
n
)
+
2
);
}
}
if
(
0
<
n
and
n
<=
max_exp
)
if
(
0
<
n
and
n
<=
max_exp
)
...
@@ -14541,9 +14541,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -14541,9 +14541,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
assert
(
k
>
n
);
assert
(
k
>
n
);
std
::
memmove
(
buf
+
(
n
+
1
),
buf
+
n
,
static_cast
<
size_t
>
(
k
-
n
));
std
::
memmove
(
buf
+
(
static_cast
<
size_t
>
(
n
)
+
1
),
buf
+
n
,
static_cast
<
size_t
>
(
k
)
-
static_cast
<
size_t
>
(
n
));
buf
[
n
]
=
'.'
;
buf
[
n
]
=
'.'
;
return
buf
+
(
k
+
1
);
return
buf
+
(
static_cast
<
size_t
>
(
k
)
+
1
);
}
}
if
(
min_exp
<
n
and
n
<=
0
)
if
(
min_exp
<
n
and
n
<=
0
)
...
@@ -14551,11 +14551,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -14551,11 +14551,11 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
// 0.[000]digits
// 0.[000]digits
// len <= 2 + (-min_exp - 1) + max_digits10
// len <= 2 + (-min_exp - 1) + max_digits10
std
::
memmove
(
buf
+
(
2
+
-
n
),
buf
,
static_cast
<
size_t
>
(
k
));
std
::
memmove
(
buf
+
(
2
+
static_cast
<
size_t
>
(
-
n
)
),
buf
,
static_cast
<
size_t
>
(
k
));
buf
[
0
]
=
'0'
;
buf
[
0
]
=
'0'
;
buf
[
1
]
=
'.'
;
buf
[
1
]
=
'.'
;
std
::
memset
(
buf
+
2
,
'0'
,
static_cast
<
size_t
>
(
-
n
));
std
::
memset
(
buf
+
2
,
'0'
,
static_cast
<
size_t
>
(
-
n
));
return
buf
+
(
2
+
(
-
n
)
+
k
);
return
buf
+
(
2
+
static_cast
<
size_t
>
(
-
n
)
+
k
);
}
}
if
(
k
==
1
)
if
(
k
==
1
)
...
@@ -14570,9 +14570,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
...
@@ -14570,9 +14570,9 @@ inline char* format_buffer(char* buf, int len, int decimal_exponent,
// d.igitsE+123
// d.igitsE+123
// len <= max_digits10 + 1 + 5
// len <= max_digits10 + 1 + 5
std
::
memmove
(
buf
+
2
,
buf
+
1
,
static_cast
<
size_t
>
(
k
-
1
)
);
std
::
memmove
(
buf
+
2
,
buf
+
1
,
static_cast
<
size_t
>
(
k
)
-
1
);
buf
[
1
]
=
'.'
;
buf
[
1
]
=
'.'
;
buf
+=
1
+
k
;
buf
+=
1
+
static_cast
<
size_t
>
(
k
)
;
}
}
*
buf
++
=
'e'
;
*
buf
++
=
'e'
;
...
...
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