Compare commits

...

11 Commits
v8.2.4 ... main

Author SHA1 Message Date
Daniel Lemire
05087a303d 8.2.5 2026-04-16 14:39:03 -04:00
Daniel Lemire
b2b1e203ba removing msys 32-bit 2026-04-16 14:38:27 -04:00
Daniel Lemire
b57ec064ad
Merge pull request #379 from mlippautz/patch-1
Replace std::min with ternary operators to avoid <algorithm> dependency
2026-04-16 14:37:13 -04:00
Michael Lippautz
001c04cc8a Remove <algorithm> include and replace std::min with ternary operators
Replaces uses of std::min with ternary operators in ascii_number.h, digit_comparison.h, and float_common.h to remove the dependency on the <algorithm> header in those files.
2026-04-16 17:17:19 +00:00
Michael Lippautz
b063de82c7
Include <algorithm> in float_common.h
`fastfloat_strncasecmp` relies on `std::min`.
2026-04-16 09:51:58 +02:00
Daniel Lemire
d7ad33a80e
Merge pull request #377 from BYVoid/fix-bazel-bzlmod
Fix Bazel build with bzlmod
2026-03-27 09:37:23 -04:00
Carbo
2027a39ba0 Update MODULE.bazel version to 8.2.4
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:42:55 +09:00
Carbo
9817d5ddaa Fix Bazel build with bzlmod by loading cc_library rule
With bzlmod, native rules like cc_library are no longer implicitly available
and must be explicitly loaded from rules_cc. Add the rules_cc dependency to
MODULE.bazel and the corresponding load statement to BUILD.bazel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 14:39:16 +09:00
Daniel Lemire
7124634005
Merge pull request #375 from fastfloat/dependabot/github_actions/github-actions-c571d227b7
Bump the github-actions group across 1 directory with 3 updates
2026-03-16 10:02:24 -04:00
dependabot[bot]
419695eba6
Bump the github-actions group across 1 directory with 3 updates
Bumps the github-actions group with 3 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/setup-node](https://github.com/actions/setup-node) and [jidicula/clang-format-action](https://github.com/jidicula/clang-format-action).


Updates `actions/upload-artifact` from 6 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

Updates `actions/setup-node` from 6.2.0 to 6.3.0
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](6044e13b5d...53b83947a5)

Updates `jidicula/clang-format-action` from 4.16.0 to 4.17.0
- [Release notes](https://github.com/jidicula/clang-format-action/releases)
- [Commits](6cd220de46...3a18028048)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-node
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: jidicula/clang-format-action
  dependency-version: 4.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 00:08:44 +00:00
Daniel Lemire
18e55e48a8 lint 2026-03-10 17:06:04 -04:00
13 changed files with 20 additions and 27 deletions

View File

@ -20,7 +20,7 @@ jobs:
fuzz-seconds: 300 fuzz-seconds: 300
output-sarif: true output-sarif: true
- name: Upload Crash - name: Upload Crash
uses: actions/upload-artifact@v6 uses: actions/upload-artifact@v7
if: failure() && steps.build.outcome == 'success' if: failure() && steps.build.outcome == 'success'
with: with:
name: artifacts name: artifacts

View File

@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2 - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
- uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 - uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
- name: Verify - name: Verify
run: emcc -v run: emcc -v

View File

@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.1.7 - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.1.7
- name: Run clang-format - name: Run clang-format
uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0 uses: jidicula/clang-format-action@3a18028048f01a66653b4e3bf8d968d2e7e2cb8b # v4.17.0
with: with:
clang-format-version: '17' clang-format-version: '17'

View File

@ -16,9 +16,6 @@ jobs:
- msystem: "MINGW64" - msystem: "MINGW64"
install: mingw-w64-x86_64-libxml2 mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-clang install: mingw-w64-x86_64-libxml2 mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-clang
type: Release type: Release
- msystem: "MINGW32"
install: mingw-w64-i686-libxml2 mingw-w64-i686-cmake mingw-w64-i686-ninja mingw-w64-i686-clang
type: Release
env: env:
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja

View File

@ -16,15 +16,9 @@ jobs:
- msystem: "MINGW64" - msystem: "MINGW64"
install: mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc install: mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc
type: Release type: Release
- msystem: "MINGW32"
install: mingw-w64-i686-cmake mingw-w64-i686-ninja mingw-w64-i686-gcc
type: Release
- msystem: "MINGW64" - msystem: "MINGW64"
install: mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc install: mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-gcc
type: Debug type: Debug
- msystem: "MINGW32"
install: mingw-w64-i686-cmake mingw-w64-i686-ninja mingw-w64-i686-gcc
type: Debug
env: env:
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja

View File

@ -1,3 +1,5 @@
load("@rules_cc//cc:cc_library.bzl", "cc_library")
cc_library( cc_library(
name = "fast_float", name = "fast_float",
hdrs = glob(["include/fast_float/*.h"]), hdrs = glob(["include/fast_float/*.h"]),

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.14) cmake_minimum_required(VERSION 3.14)
project(fast_float VERSION 8.2.4 LANGUAGES CXX) project(fast_float VERSION 8.2.5 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

@ -2,8 +2,10 @@
module( module(
name = "fast_float", name = "fast_float",
version = "6.1.6", version = "8.2.4",
compatibility_level = 6, compatibility_level = 8,
) )
bazel_dep(name = "doctest", version = "2.4.11", dev_dependency = True) bazel_dep(name = "doctest", version = "2.4.11", dev_dependency = True)
bazel_dep(name = "rules_cc", version = "0.2.17")

View File

@ -541,7 +541,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.2.4 GIT_TAG tags/v8.2.5
GIT_SHALLOW TRUE) GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(fast_float) FetchContent_MakeAvailable(fast_float)
@ -557,7 +557,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.2.4) GIT_TAG v8.2.5)
``` ```
## Using as single header ## Using as single header
@ -569,7 +569,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.2.4/fast_float.h> <https://github.com/fastfloat/fast_float/releases/download/v8.2.5/fast_float.h>
## Benchmarking ## Benchmarking

View File

@ -594,7 +594,7 @@ parse_int_string(UC const *p, UC const *pend, T &value,
((digits + 0x46464646u) | (digits - 0x30303030u)) & 0x80808080u; ((digits + 0x46464646u) | (digits - 0x30303030u)) & 0x80808080u;
uint32_t tz = (uint32_t)countr_zero_32(magic); // 7, 15, 23, 31, or 32 uint32_t tz = (uint32_t)countr_zero_32(magic); // 7, 15, 23, 31, or 32
uint32_t nd = (tz == 32) ? 4 : (tz >> 3); uint32_t nd = (tz == 32) ? 4 : (tz >> 3);
nd = (uint32_t)std::min((size_t)nd, len); nd = (uint32_t)(nd < len ? nd : len);
if (nd == 0) { if (nd == 0) {
if (has_leading_zeros) { if (has_leading_zeros) {
value = 0; value = 0;

View File

@ -1,7 +1,6 @@
#ifndef FASTFLOAT_DIGIT_COMPARISON_H #ifndef FASTFLOAT_DIGIT_COMPARISON_H
#define FASTFLOAT_DIGIT_COMPARISON_H #define FASTFLOAT_DIGIT_COMPARISON_H
#include <algorithm>
#include <cstdint> #include <cstdint>
#include <cstring> #include <cstring>
#include <iterator> #include <iterator>
@ -109,7 +108,7 @@ fastfloat_really_inline FASTFLOAT_CONSTEXPR14 void round(adjusted_mantissa &am,
if (-am.power2 >= mantissa_shift) { if (-am.power2 >= mantissa_shift) {
// have a denormal float // have a denormal float
int32_t shift = -am.power2 + 1; int32_t shift = -am.power2 + 1;
cb(am, std::min<int32_t>(shift, 64)); cb(am, (shift < 64 ? shift : 64));
// check for round-up: if rounding-nearest carried us to the hidden bit. // check for round-up: if rounding-nearest carried us to the hidden bit.
am.power2 = (am.mantissa < am.power2 = (am.mantissa <
(uint64_t(1) << binary_format<T>::mantissa_explicit_bits())) (uint64_t(1) << binary_format<T>::mantissa_explicit_bits()))

View File

@ -18,7 +18,7 @@
#define FASTFLOAT_VERSION_MAJOR 8 #define FASTFLOAT_VERSION_MAJOR 8
#define FASTFLOAT_VERSION_MINOR 2 #define FASTFLOAT_VERSION_MINOR 2
#define FASTFLOAT_VERSION_PATCH 4 #define FASTFLOAT_VERSION_PATCH 5
#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)
@ -398,7 +398,7 @@ fastfloat_strncasecmp(UC const *actual_mixedcase, UC const *expected_lowercase,
size_t sz{8 / (sizeof(UC))}; size_t sz{8 / (sizeof(UC))};
for (size_t i = 0; i < length; i += sz) { for (size_t i = 0; i < length; i += sz) {
val1 = val2 = 0; val1 = val2 = 0;
sz = std::min(sz, length - i); sz = sz < (length - i) ? sz : length - i;
::memcpy(&val1, actual_mixedcase + i, sz * sizeof(UC)); ::memcpy(&val1, actual_mixedcase + i, sz * sizeof(UC));
::memcpy(&val2, expected_lowercase + i, sz * sizeof(UC)); ::memcpy(&val2, expected_lowercase + i, sz * sizeof(UC));
val1 |= mask; val1 |= mask;

View File

@ -155,7 +155,7 @@ template <> struct from_chars_caller<std::float32_t> {
// if std::float32_t is defined, and we are in C++23 mode; macro set for // if std::float32_t is defined, and we are in C++23 mode; macro set for
// float32; set value to float due to equivalence between float and // float32; set value to float due to equivalence between float and
// float32_t // float32_t
float val; float val = 0.0f;
auto ret = from_chars_advanced(first, last, val, options); auto ret = from_chars_advanced(first, last, val, options);
value = val; value = val;
return ret; return ret;
@ -172,7 +172,7 @@ template <> struct from_chars_caller<std::float64_t> {
// if std::float64_t is defined, and we are in C++23 mode; macro set for // if std::float64_t is defined, and we are in C++23 mode; macro set for
// float64; set value as double due to equivalence between double and // float64; set value as double due to equivalence between double and
// float64_t // float64_t
double val; double val = 0.0;
auto ret = from_chars_advanced(first, last, val, options); auto ret = from_chars_advanced(first, last, val, options);
value = val; value = val;
return ret; return ret;
@ -456,8 +456,7 @@ template <size_t TypeIx> struct from_chars_advanced_caller {
template <> struct from_chars_advanced_caller<1> { template <> struct from_chars_advanced_caller<1> {
template <typename T, typename UC> template <typename T, typename UC>
fastfloat_really_inline fastfloat_really_inline FASTFLOAT_CONSTEXPR20 static from_chars_result_t<UC>
FASTFLOAT_CONSTEXPR20 static from_chars_result_t<UC>
call(UC const *first, UC const *last, T &value, call(UC const *first, UC const *last, T &value,
parse_options_t<UC> options) noexcept { parse_options_t<UC> options) noexcept {
return from_chars_float_advanced(first, last, value, options); return from_chars_float_advanced(first, last, value, options);