Merge pull request #326 from fastfloat/patch803

Release candidate 8.0.3
This commit is contained in:
Daniel Lemire 2025-09-18 09:37:20 -06:00 committed by GitHub
commit 2aa6d0ba72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.14) 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(FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat")
set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD}) set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD})
option(FASTFLOAT_TEST "Enable tests" OFF) option(FASTFLOAT_TEST "Enable tests" OFF)

View File

@ -516,7 +516,7 @@ sufficiently recent version of CMake (3.11 or better at least):
FetchContent_Declare( FetchContent_Declare(
fast_float fast_float
GIT_REPOSITORY https://github.com/fastfloat/fast_float.git GIT_REPOSITORY https://github.com/fastfloat/fast_float.git
GIT_TAG tags/v8.0.2 GIT_TAG tags/v8.0.3
GIT_SHALLOW TRUE) GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(fast_float) FetchContent_MakeAvailable(fast_float)
@ -532,7 +532,7 @@ You may also use [CPM](https://github.com/cpm-cmake/CPM.cmake), like so:
CPMAddPackage( CPMAddPackage(
NAME fast_float NAME fast_float
GITHUB_REPOSITORY "fastfloat/fast_float" GITHUB_REPOSITORY "fastfloat/fast_float"
GIT_TAG v8.0.2) GIT_TAG v8.0.3)
``` ```
## Using as single header ## Using as single header
@ -544,7 +544,7 @@ if desired as described in the command line help.
You may directly download automatically generated single-header files: You may directly download automatically generated single-header files:
<https://github.com/fastfloat/fast_float/releases/download/v8.0.2/fast_float.h> <https://github.com/fastfloat/fast_float/releases/download/v8.0.3/fast_float.h>
## Benchmarking ## Benchmarking

View File

@ -17,7 +17,7 @@
#define FASTFLOAT_VERSION_MAJOR 8 #define FASTFLOAT_VERSION_MAJOR 8
#define FASTFLOAT_VERSION_MINOR 0 #define FASTFLOAT_VERSION_MINOR 0
#define FASTFLOAT_VERSION_PATCH 2 #define FASTFLOAT_VERSION_PATCH 3
#define FASTFLOAT_STRINGIZE_IMPL(x) #x #define FASTFLOAT_STRINGIZE_IMPL(x) #x
#define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x) #define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x)
@ -1132,13 +1132,12 @@ template <typename T> constexpr uint64_t int_luts<T>::min_safe_u64[];
template <typename UC> template <typename UC>
fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) { 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<UC>::type; using UnsignedUC = typename std::make_unsigned<UC>::type;
auto uc = static_cast<UnsignedUC>(c); return int_luts<>::chdigit[static_cast<unsigned char>(
// For types larger than one byte, we need to force an index with sentinel static_cast<UnsignedUC>(c) &
// value (using index zero because that is easiest) if any byte other than static_cast<UnsignedUC>(
// the low byte is non-zero. -((static_cast<UnsignedUC>(c) & ~0xFFull) == 0)))];
auto mask = static_cast<UnsignedUC>(-((uc & ~0xFFull) == 0));
return int_luts<>::chdigit[static_cast<unsigned char>(uc & mask)];
} }
fastfloat_really_inline constexpr size_t max_digits_u64(int base) { fastfloat_really_inline constexpr size_t max_digits_u64(int base) {