Skip to content

Commit affd6f5

Browse files
committed
Update fast_float: 8.0.0 => 8.0.2
1 parent c740f21 commit affd6f5

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed

3rdparty/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## Box2D
1313
- [![Upstream](https://img.shields.io/github/v/release/erincatto/box2d?label=Upstream)](https://github.com/erincatto/box2d)
14-
- Version: 3.1.0
14+
- Version: 3.1.1
1515
- License: MIT
1616

1717
## Bullet
@@ -57,7 +57,7 @@
5757

5858
## fast_float
5959
- [![Upstream](https://img.shields.io/github/v/release/fastfloat/fast_float?label=Upstream)](https://github.com/fastfloat/fast_float)
60-
- Version: 8.0.0
60+
- Version: 8.0.2
6161
- License: MIT
6262

6363
## flatbuffers

3rdparty/fast_float/ascii_number.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ report_parse_error(UC const *p, parse_error error) {
279279

280280
// Assuming that you use no more than 19 digits, this will
281281
// parse an ASCII string.
282-
template <typename UC>
282+
template <bool basic_json_fmt, typename UC>
283283
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 parsed_number_string_t<UC>
284284
parse_number_string(UC const *p, UC const *pend,
285285
parse_options_t<UC> options) noexcept {
@@ -292,20 +292,20 @@ parse_number_string(UC const *p, UC const *pend,
292292
// assume p < pend, so dereference without checks;
293293
answer.negative = (*p == UC('-'));
294294
// C++17 20.19.3.(7.1) explicitly forbids '+' sign here
295-
if ((*p == UC('-')) ||
296-
(uint64_t(fmt & chars_format::allow_leading_plus) &&
297-
!uint64_t(fmt & detail::basic_json_fmt) && *p == UC('+'))) {
295+
if ((*p == UC('-')) || (uint64_t(fmt & chars_format::allow_leading_plus) &&
296+
!basic_json_fmt && *p == UC('+'))) {
298297
++p;
299298
if (p == pend) {
300299
return report_parse_error<UC>(
301300
p, parse_error::missing_integer_or_dot_after_sign);
302301
}
303-
if (uint64_t(fmt & detail::basic_json_fmt)) {
302+
FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
304303
if (!is_integer(*p)) { // a sign must be followed by an integer
305304
return report_parse_error<UC>(p,
306305
parse_error::missing_integer_after_sign);
307306
}
308-
} else {
307+
}
308+
else {
309309
if (!is_integer(*p) &&
310310
(*p !=
311311
decimal_point)) { // a sign must be followed by an integer or the dot
@@ -329,7 +329,7 @@ parse_number_string(UC const *p, UC const *pend,
329329
UC const *const end_of_integer_part = p;
330330
int64_t digit_count = int64_t(end_of_integer_part - start_digits);
331331
answer.integer = span<UC const>(start_digits, size_t(digit_count));
332-
if (uint64_t(fmt & detail::basic_json_fmt)) {
332+
FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
333333
// at least 1 digit in integer part, without leading zeros
334334
if (digit_count == 0) {
335335
return report_parse_error<UC>(p, parse_error::no_digits_in_integer_part);
@@ -358,14 +358,14 @@ parse_number_string(UC const *p, UC const *pend,
358358
answer.fraction = span<UC const>(before, size_t(p - before));
359359
digit_count -= exponent;
360360
}
361-
if (uint64_t(fmt & detail::basic_json_fmt)) {
361+
FASTFLOAT_IF_CONSTEXPR17(basic_json_fmt) {
362362
// at least 1 digit in fractional part
363363
if (has_decimal_point && exponent == 0) {
364364
return report_parse_error<UC>(p,
365365
parse_error::no_digits_in_fractional_part);
366366
}
367-
} else if (digit_count ==
368-
0) { // we must have encountered at least one integer!
367+
}
368+
else if (digit_count == 0) { // we must have encountered at least one integer!
369369
return report_parse_error<UC>(p, parse_error::no_digits_in_mantissa);
370370
}
371371
int64_t exp_number = 0; // explicit exponential part

3rdparty/fast_float/constexpr_feature_detect.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#endif
99

1010
// Testing for https://wg21.link/N3652, adopted in C++14
11-
#if __cpp_constexpr >= 201304
11+
#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304
1212
#define FASTFLOAT_CONSTEXPR14 constexpr
1313
#else
1414
#define FASTFLOAT_CONSTEXPR14
@@ -27,8 +27,15 @@
2727
#define FASTFLOAT_HAS_IS_CONSTANT_EVALUATED 0
2828
#endif
2929

30+
#if defined(__cpp_if_constexpr) && __cpp_if_constexpr >= 201606L
31+
#define FASTFLOAT_IF_CONSTEXPR17(x) if constexpr (x)
32+
#else
33+
#define FASTFLOAT_IF_CONSTEXPR17(x) if (x)
34+
#endif
35+
3036
// Testing for relevant C++20 constexpr library features
3137
#if FASTFLOAT_HAS_IS_CONSTANT_EVALUATED && FASTFLOAT_HAS_BIT_CAST && \
38+
defined(__cpp_lib_constexpr_algorithms) && \
3239
__cpp_lib_constexpr_algorithms >= 201806L /*For std::copy and std::fill*/
3340
#define FASTFLOAT_CONSTEXPR20 constexpr
3441
#define FASTFLOAT_IS_CONSTEXPR 1

3rdparty/fast_float/float_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
#include <type_traits>
1010
#include <system_error>
1111
#ifdef __has_include
12-
#if __has_include(<stdfloat>) && (__cplusplus > 202002L || _MSVC_LANG > 202002L)
12+
#if __has_include(<stdfloat>) && (__cplusplus > 202002L || (defined(_MSVC_LANG) && (_MSVC_LANG > 202002L)))
1313
#include <stdfloat>
1414
#endif
1515
#endif
1616
#include "constexpr_feature_detect.h"
1717

1818
#define FASTFLOAT_VERSION_MAJOR 8
1919
#define FASTFLOAT_VERSION_MINOR 0
20-
#define FASTFLOAT_VERSION_PATCH 0
20+
#define FASTFLOAT_VERSION_PATCH 2
2121

2222
#define FASTFLOAT_STRINGIZE_IMPL(x) #x
2323
#define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x)

3rdparty/fast_float/parse_number.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
305305
return answer;
306306
}
307307
parsed_number_string_t<UC> pns =
308-
parse_number_string<UC>(first, last, options);
308+
uint64_t(fmt & detail::basic_json_fmt)
309+
? parse_number_string<true, UC>(first, last, options)
310+
: parse_number_string<false, UC>(first, last, options);
309311
if (!pns.valid) {
310312
if (uint64_t(fmt & chars_format::no_infnan)) {
311313
answer.ec = std::errc::invalid_argument;

0 commit comments

Comments
 (0)