mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
lint
This commit is contained in:
parent
95dedd0aed
commit
6f0049a2e7
@ -236,7 +236,7 @@ int main(int argc, char **argv) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if(argc > 1) {
|
if (argc > 1) {
|
||||||
fileload(argv[1]);
|
fileload(argv[1]);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -292,8 +292,7 @@ parse_number_string(UC const *p, UC const *pend,
|
|||||||
// assume p < pend, so dereference without checks;
|
// assume p < pend, so dereference without checks;
|
||||||
answer.negative = (*p == UC('-'));
|
answer.negative = (*p == UC('-'));
|
||||||
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
|
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
|
||||||
if ((*p == UC('-')) ||
|
if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
|
||||||
(uint64_t(fmt & chars_format::allow_leading_plus) &&
|
|
||||||
!basic_json_fmt && *p == UC('+'))) {
|
!basic_json_fmt && *p == UC('+'))) {
|
||||||
++p;
|
++p;
|
||||||
if (p == pend) {
|
if (p == pend) {
|
||||||
|
|||||||
@ -304,9 +304,10 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
|||||||
answer.ptr = first;
|
answer.ptr = first;
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
parsed_number_string_t<UC> pns = uint64_t(fmt & detail::basic_json_fmt) ?
|
parsed_number_string_t<UC> pns =
|
||||||
parse_number_string<true, UC>(first, last, options) :
|
uint64_t(fmt & detail::basic_json_fmt)
|
||||||
parse_number_string<false, UC>(first, last, options);
|
? parse_number_string<true, UC>(first, last, options)
|
||||||
|
: parse_number_string<false, UC>(first, last, options);
|
||||||
if (!pns.valid) {
|
if (!pns.valid) {
|
||||||
if (uint64_t(fmt & chars_format::no_infnan)) {
|
if (uint64_t(fmt & chars_format::no_infnan)) {
|
||||||
answer.ec = std::errc::invalid_argument;
|
answer.ec = std::errc::invalid_argument;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user