Skip to content

Commit 2aa6d0b

Browse files
authored
Merge pull request #326 from fastfloat/patch803
Release candidate 8.0.3
2 parents 2d65744 + 0b6d911 commit 2aa6d0b

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.14)
22

33

4-
project(fast_float VERSION 8.0.2 LANGUAGES CXX)
4+
project(fast_float VERSION 8.0.3 LANGUAGES CXX)
55
set(FASTFLOAT_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for fastfloat")
66
set(CMAKE_CXX_STANDARD ${FASTFLOAT_CXX_STANDARD})
77
option(FASTFLOAT_TEST "Enable tests" OFF)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ sufficiently recent version of CMake (3.11 or better at least):
516516
FetchContent_Declare(
517517
fast_float
518518
GIT_REPOSITORY https://github.com/fastfloat/fast_float.git
519-
GIT_TAG tags/v8.0.2
519+
GIT_TAG tags/v8.0.3
520520
GIT_SHALLOW TRUE)
521521
522522
FetchContent_MakeAvailable(fast_float)
@@ -532,7 +532,7 @@ You may also use [CPM](https://github.com/cpm-cmake/CPM.cmake), like so:
532532
CPMAddPackage(
533533
NAME fast_float
534534
GITHUB_REPOSITORY "fastfloat/fast_float"
535-
GIT_TAG v8.0.2)
535+
GIT_TAG v8.0.3)
536536
```
537537

538538
## Using as single header
@@ -544,7 +544,7 @@ if desired as described in the command line help.
544544

545545
You may directly download automatically generated single-header files:
546546

547-
<https://github.com/fastfloat/fast_float/releases/download/v8.0.2/fast_float.h>
547+
<https://github.com/fastfloat/fast_float/releases/download/v8.0.3/fast_float.h>
548548

549549
## Benchmarking
550550

include/fast_float/float_common.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

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

2222
#define FASTFLOAT_STRINGIZE_IMPL(x) #x
2323
#define FASTFLOAT_STRINGIZE(x) FASTFLOAT_STRINGIZE_IMPL(x)
@@ -1132,13 +1132,12 @@ template <typename T> constexpr uint64_t int_luts<T>::min_safe_u64[];
11321132

11331133
template <typename UC>
11341134
fastfloat_really_inline constexpr uint8_t ch_to_digit(UC c) {
1135+
// wchar_t and char can be signed, so we need to be careful.
11351136
using UnsignedUC = typename std::make_unsigned<UC>::type;
1136-
auto uc = static_cast<UnsignedUC>(c);
1137-
// For types larger than one byte, we need to force an index with sentinel
1138-
// value (using index zero because that is easiest) if any byte other than
1139-
// the low byte is non-zero.
1140-
auto mask = static_cast<UnsignedUC>(-((uc & ~0xFFull) == 0));
1141-
return int_luts<>::chdigit[static_cast<unsigned char>(uc & mask)];
1137+
return int_luts<>::chdigit[static_cast<unsigned char>(
1138+
static_cast<UnsignedUC>(c) &
1139+
static_cast<UnsignedUC>(
1140+
-((static_cast<UnsignedUC>(c) & ~0xFFull) == 0)))];
11421141
}
11431142

11441143
fastfloat_really_inline constexpr size_t max_digits_u64(int base) {

0 commit comments

Comments
 (0)