mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-08 10:46:52 +08:00
unfck lint.
This commit is contained in:
parent
2aba1685b0
commit
a8c78f4403
@ -84,8 +84,10 @@ fastfloat_really_inline uint64_t simd_read8_to_u64(__m128i const &data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fastfloat_really_inline uint64_t simd_read8_to_u64(char16_t const *chars) {
|
fastfloat_really_inline uint64_t simd_read8_to_u64(char16_t const *chars) {
|
||||||
return simd_read8_to_u64(
|
return simd_read8_to_u64(_mm_loadu_si128(reinterpret_cast<__m128i const *>(
|
||||||
_mm_loadu_si128(reinterpret_cast<__m128i const *>(chars))); //TODO: V1032 https://pvs-studio.com/en/docs/warnings/v1032/ The pointer 'chars' is cast to a more strictly aligned pointer type.
|
chars))); // TODO: V1032 https://pvs-studio.com/en/docs/warnings/v1032/
|
||||||
|
// The pointer 'chars' is cast to a more strictly aligned
|
||||||
|
// pointer type.
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(FASTFLOAT_NEON)
|
#elif defined(FASTFLOAT_NEON)
|
||||||
@ -155,8 +157,10 @@ simd_parse_if_eight_digits_unrolled(char16_t const *chars,
|
|||||||
}
|
}
|
||||||
#ifdef FASTFLOAT_SSE2
|
#ifdef FASTFLOAT_SSE2
|
||||||
// Load 8 UTF-16 characters (16 bytes)
|
// Load 8 UTF-16 characters (16 bytes)
|
||||||
__m128i const data =
|
__m128i const data = _mm_loadu_si128(reinterpret_cast<__m128i const *>(
|
||||||
_mm_loadu_si128(reinterpret_cast<__m128i const *>(chars)); //TODO: V1032 https://pvs-studio.com/en/docs/warnings/v1032/ The pointer 'chars' is cast to a more strictly aligned pointer type.
|
chars)); // TODO: V1032 https://pvs-studio.com/en/docs/warnings/v1032/ The
|
||||||
|
// pointer 'chars' is cast to a more strictly aligned pointer
|
||||||
|
// type.
|
||||||
|
|
||||||
// Branchless "are all digits?" trick from Lemire:
|
// Branchless "are all digits?" trick from Lemire:
|
||||||
// (x - '0') <= 9 <=> (x + 32720) <= 32729
|
// (x - '0') <= 9 <=> (x + 32720) <= 32729
|
||||||
@ -259,8 +263,8 @@ template <typename UC> struct parsed_number_string_t {
|
|||||||
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
|
||||||
bool negative{false};
|
bool negative{false};
|
||||||
#endif
|
#endif
|
||||||
bool invalid{false}; // be optimistic
|
bool invalid{false}; // be optimistic
|
||||||
bool too_many_digits{false}; // be optimistic
|
bool too_many_digits{false}; // be optimistic
|
||||||
parse_error error{parse_error::no_error}; // be optimistic
|
parse_error error{parse_error::no_error}; // be optimistic
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -205,22 +205,6 @@ FASTFLOAT_CONSTEXPR20 To bit_cast(const From &from) {
|
|||||||
#define FASTFLOAT_HAS_SIMD 1
|
#define FASTFLOAT_HAS_SIMD 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Don't silent this. This is an important warning!
|
|
||||||
//#if defined(__GNUC__)
|
|
||||||
// disable -Wcast-align=strict (GCC only)
|
|
||||||
//#define FASTFLOAT_SIMD_DISABLE_WARNINGS \
|
|
||||||
// _Pragma("GCC diagnostic push") \
|
|
||||||
// _Pragma("GCC diagnostic ignored \"-Wcast-align\"")
|
|
||||||
//#else
|
|
||||||
//#define FASTFLOAT_SIMD_DISABLE_WARNINGS
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if defined(__GNUC__)
|
|
||||||
//#define FASTFLOAT_SIMD_RESTORE_WARNINGS _Pragma("GCC diagnostic pop")
|
|
||||||
//#else
|
|
||||||
//#define FASTFLOAT_SIMD_RESTORE_WARNINGS
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
#ifdef FASTFLOAT_VISUAL_STUDIO
|
#ifdef FASTFLOAT_VISUAL_STUDIO
|
||||||
#define fastfloat_really_inline __forceinline
|
#define fastfloat_really_inline __forceinline
|
||||||
#else
|
#else
|
||||||
@ -501,8 +485,9 @@ full_multiplication(uint64_t a, uint64_t b) noexcept {
|
|||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Value of the mantissa.
|
// Value of the mantissa. An unsigned int avoids signed overflows (which are
|
||||||
typedef uint_fast64_t am_mant_t; // an unsigned int avoids signed overflows (which are bad)
|
// bad)
|
||||||
|
typedef uint_fast64_t am_mant_t;
|
||||||
// Size of bits in the mantissa and path and rounding shifts
|
// Size of bits in the mantissa and path and rounding shifts
|
||||||
typedef int_fast8_t am_bits_t;
|
typedef int_fast8_t am_bits_t;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user