From 48fc5404d4184111c0c771f4c1e841f652a532fd Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 18 Sep 2025 07:44:05 -0600 Subject: [PATCH 1/3] compatibility fix --- include/fast_float/float_common.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 2b8a528..e14c7dc 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -1132,13 +1132,10 @@ template constexpr uint64_t int_luts::min_safe_u64[]; template fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) { + // wchar_t and char can be signed, so we need to be careful. using UnsignedUC = typename std::make_unsigned::type; - auto uc = static_cast(c); - // For types larger than one byte, we need to force an index with sentinel - // value (using index zero because that is easiest) if any byte other than - // the low byte is non-zero. - auto mask = static_cast(-((uc & ~0xFFull) == 0)); - return int_luts<>::chdigit[static_cast(uc & mask)]; + return int_luts<>::chdigit[static_cast(static_cast(c) + & static_cast(-((static_cast(c) & ~0xFFull) == 0)))]; } fastfloat_really_inline constexpr size_t max_digits_u64(int base) { From bb956b29db5a0fe407a5c9c1fe2f8013be673d69 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 18 Sep 2025 07:44:53 -0600 Subject: [PATCH 2/3] release candidate 8.0.3 --- CMakeLists.txt | 2 +- README.md | 6 +++--- include/fast_float/float_common.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a86dfc2..2b979a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14) -project(fast_float VERSION 8.0.2 LANGUAGES CXX) +project(fast_float VERSION 8.0.3 LANGUAGES CXX) set(FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat") set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD}) option(FASTFLOAT_TEST "Enable tests" OFF) diff --git a/README.md b/README.md index f828673..b9ee814 100644 --- a/README.md +++ b/README.md @@ -489,7 +489,7 @@ sufficiently recent version of CMake (3.11 or better at least): FetchContent_Declare( fast_float GIT_REPOSITORY https://github.com/fastfloat/fast_float.git - GIT_TAG tags/v8.0.2 + GIT_TAG tags/v8.0.3 GIT_SHALLOW TRUE) FetchContent_MakeAvailable(fast_float) @@ -505,7 +505,7 @@ You may also use [CPM](https://github.com/cpm-cmake/CPM.cmake), like so: CPMAddPackage( NAME fast_float GITHUB_REPOSITORY "fastfloat/fast_float" - GIT_TAG v8.0.2) + GIT_TAG v8.0.3) ``` ## Using as single header @@ -517,7 +517,7 @@ if desired as described in the command line help. You may directly download automatically generated single-header files: - + ## Benchmarking diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index e14c7dc..1db1695 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -17,7 +17,7 @@ #define FASTFLOAT_VERSION_MAJOR 8 #define FASTFLOAT_VERSION_MINOR 0 -#define FASTFLOAT_VERSION_PATCH 2 +#define FASTFLOAT_VERSION_PATCH 3 #define FASTFLOAT_STRINGIZE_IMPL(x) #x #define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x) @@ -1134,7 +1134,7 @@ template fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) { // wchar_t and char can be signed, so we need to be careful. using UnsignedUC = typename std::make_unsigned::type; - return int_luts<>::chdigit[static_cast(static_cast(c) + return int_luts<>::chdigit[static_cast(static_cast(c) & static_cast(-((static_cast(c) & ~0xFFull) == 0)))]; } From 0b6d91122005a53d06f21aa95adb944033fb7cd6 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Thu, 18 Sep 2025 08:30:28 -0600 Subject: [PATCH 3/3] format --- include/fast_float/float_common.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 1db1695..fcb87d1 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -1134,8 +1134,10 @@ template fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) { // wchar_t and char can be signed, so we need to be careful. using UnsignedUC = typename std::make_unsigned::type; - return int_luts<>::chdigit[static_cast(static_cast(c) - & static_cast(-((static_cast(c) & ~0xFFull) == 0)))]; + return int_luts<>::chdigit[static_cast( + static_cast(c) & + static_cast( + -((static_cast(c) & ~0xFFull) == 0)))]; } fastfloat_really_inline constexpr size_t max_digits_u64(int base) {