mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-09 11:16:45 +08:00
style cleanup.
This commit is contained in:
parent
89c69caccc
commit
a9d84bbcb2
@ -53,7 +53,6 @@ time_it_ns(std::vector<std::basic_string<CharT>> &lines, T const &function,
|
|||||||
std::vector<counters::event_count> aggregate;
|
std::vector<counters::event_count> aggregate;
|
||||||
bool printed_bug = false;
|
bool printed_bug = false;
|
||||||
for (uint32_t i = 0; i != repeat; ++i) {
|
for (uint32_t i = 0; i != repeat; ++i) {
|
||||||
|
|
||||||
collector.start();
|
collector.start();
|
||||||
auto const ts = function(lines);
|
auto const ts = function(lines);
|
||||||
aggregate.push_back(collector.end());
|
aggregate.push_back(collector.end());
|
||||||
@ -135,7 +134,6 @@ time_it_ns(std::vector<std::basic_string<CharT>> &lines, T const &function,
|
|||||||
double min_value = DBL_MAX;
|
double min_value = DBL_MAX;
|
||||||
bool printed_bug = false;
|
bool printed_bug = false;
|
||||||
for (size_t i = 0; i != repeat; ++i) {
|
for (size_t i = 0; i != repeat; ++i) {
|
||||||
|
|
||||||
t1 = std::chrono::high_resolution_clock::now();
|
t1 = std::chrono::high_resolution_clock::now();
|
||||||
auto const ts = function(lines);
|
auto const ts = function(lines);
|
||||||
t2 = std::chrono::high_resolution_clock::now();
|
t2 = std::chrono::high_resolution_clock::now();
|
||||||
|
|||||||
@ -537,7 +537,6 @@ template <typename T, typename UC>
|
|||||||
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
||||||
parse_int_string(UC const *p, UC const *pend, T &value,
|
parse_int_string(UC const *p, UC const *pend, T &value,
|
||||||
parse_options_t<UC> const options) noexcept {
|
parse_options_t<UC> const options) noexcept {
|
||||||
|
|
||||||
from_chars_result_t<UC> answer;
|
from_chars_result_t<UC> answer;
|
||||||
|
|
||||||
auto const *const first = p;
|
auto const *const first = p;
|
||||||
|
|||||||
@ -28,7 +28,6 @@ namespace fast_float {
|
|||||||
* of 5 greater than 308.
|
* of 5 greater than 308.
|
||||||
*/
|
*/
|
||||||
template <class unused = void> struct powers_template {
|
template <class unused = void> struct powers_template {
|
||||||
|
|
||||||
constexpr static am_pow_t smallest_power_of_five =
|
constexpr static am_pow_t smallest_power_of_five =
|
||||||
binary_format<double>::smallest_power_of_ten();
|
binary_format<double>::smallest_power_of_ten();
|
||||||
constexpr static am_pow_t largest_power_of_five =
|
constexpr static am_pow_t largest_power_of_five =
|
||||||
|
|||||||
@ -202,7 +202,6 @@ clinger_fast_path_impl(am_mant_t const mantissa, am_pow_t const exponent,
|
|||||||
bool const is_negative,
|
bool const is_negative,
|
||||||
#endif
|
#endif
|
||||||
T &value) noexcept {
|
T &value) noexcept {
|
||||||
|
|
||||||
// The implementation of the Clinger's fast path is convoluted because
|
// The implementation of the Clinger's fast path is convoluted because
|
||||||
// we want round-to-nearest in all cases, irrespective of the rounding mode
|
// we want round-to-nearest in all cases, irrespective of the rounding mode
|
||||||
// selected on the thread.
|
// selected on the thread.
|
||||||
@ -323,7 +322,6 @@ template <typename T, typename UC>
|
|||||||
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
||||||
from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
||||||
parse_options_t<UC> const options) noexcept {
|
parse_options_t<UC> const options) noexcept {
|
||||||
|
|
||||||
static_assert(is_supported_float_type<T>::value,
|
static_assert(is_supported_float_type<T>::value,
|
||||||
"only some floating-point types are supported");
|
"only some floating-point types are supported");
|
||||||
static_assert(is_supported_char_type<UC>::value,
|
static_assert(is_supported_char_type<UC>::value,
|
||||||
@ -377,7 +375,6 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
|||||||
template <typename T, typename UC, typename>
|
template <typename T, typename UC, typename>
|
||||||
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
||||||
from_chars(UC const *first, UC const *last, T &value, int const base) noexcept {
|
from_chars(UC const *first, UC const *last, T &value, int const base) noexcept {
|
||||||
|
|
||||||
static_assert(is_supported_integer_type<T>::value,
|
static_assert(is_supported_integer_type<T>::value,
|
||||||
"only integer types are supported");
|
"only integer types are supported");
|
||||||
static_assert(is_supported_char_type<UC>::value,
|
static_assert(is_supported_char_type<UC>::value,
|
||||||
@ -498,7 +495,6 @@ template <typename T, typename UC>
|
|||||||
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
FASTFLOAT_CONSTEXPR20 from_chars_result_t<UC>
|
||||||
from_chars_int_advanced(UC const *first, UC const *last, T &value,
|
from_chars_int_advanced(UC const *first, UC const *last, T &value,
|
||||||
parse_options_t<UC> const options) noexcept {
|
parse_options_t<UC> const options) noexcept {
|
||||||
|
|
||||||
static_assert(is_supported_integer_type<T>::value,
|
static_assert(is_supported_integer_type<T>::value,
|
||||||
"only integer types are supported");
|
"only integer types are supported");
|
||||||
static_assert(is_supported_char_type<UC>::value,
|
static_assert(is_supported_char_type<UC>::value,
|
||||||
|
|||||||
@ -51,7 +51,6 @@ template <typename T> bool test() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
std::cout << "32 bits checks" << std::endl;
|
std::cout << "32 bits checks" << std::endl;
|
||||||
Assert(test<float>());
|
Assert(test<float>());
|
||||||
|
|
||||||
|
|||||||
@ -256,7 +256,6 @@ bool tester(uint64_t seed, size_t volume) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || \
|
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || \
|
||||||
defined(sun) || defined(__sun)
|
defined(sun) || defined(__sun)
|
||||||
std::cout << "Warning: msys/cygwin or solaris detected." << std::endl;
|
std::cout << "Warning: msys/cygwin or solaris detected." << std::endl;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user