From 649f2460dbd8c92376a0853da93210c398369a1a Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 22 Sep 2023 09:07:43 -0700 Subject: [PATCH] Apply clang-format --- include/fmt/format.h | 45 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 30addcb7..8e64b8be 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1740,7 +1740,6 @@ FMT_CONSTEXPR inline fp operator*(fp x, fp y) { return {multiply(x.f, y.f), x.e + y.e + 64}; } - template () == num_bits()> using convert_float_result = conditional_t::value || doublish, double, T>; @@ -3160,8 +3159,10 @@ FMT_CONSTEXPR20 inline void format_dragon(basic_fp value, } if (buf[0] == overflow) { buf[0] = '1'; - if ((flags & dragon::fixed) != 0) buf.push_back('0'); - else ++exp10; + if ((flags & dragon::fixed) != 0) + buf.push_back('0'); + else + ++exp10; } return; } @@ -3278,7 +3279,6 @@ FMT_CONSTEXPR inline uint32_t fractional_part_rounding_thresholds(int index) { template FMT_CONSTEXPR20 auto format_float(Float value, int precision, float_specs specs, buffer& buf) -> int { - // float is passed as double to reduce the number of instantiations. static_assert(!std::is_same::value, ""); FMT_ASSERT(value >= 0, "value is negative"); @@ -3480,12 +3480,12 @@ FMT_CONSTEXPR20 auto format_float(Float value, int precision, float_specs specs, // fractional part is strictly larger than 1/2. if (precision < 9) { uint32_t fractional_part = static_cast(prod); - should_round_up = fractional_part >= - fractional_part_rounding_thresholds - (8 - number_of_digits_to_print) || - ((fractional_part >> 31) & - ((digits & 1) | (second_third_subsegments != 0) | - has_more_segments)) != 0; + should_round_up = + fractional_part >= fractional_part_rounding_thresholds( + 8 - number_of_digits_to_print) || + ((fractional_part >> 31) & + ((digits & 1) | (second_third_subsegments != 0) | + has_more_segments)) != 0; } // Rounding at the subsegment boundary. // In this case, the fractional part is at least 1/2 if and only if @@ -3520,12 +3520,12 @@ FMT_CONSTEXPR20 auto format_float(Float value, int precision, float_specs specs, // of 19 digits, so in this case the third segment should be // consisting of a genuine digit from the input. uint32_t fractional_part = static_cast(prod); - should_round_up = fractional_part >= - fractional_part_rounding_thresholds - (8 - number_of_digits_to_print) || - ((fractional_part >> 31) & - ((digits & 1) | (third_subsegment != 0) | - has_more_segments)) != 0; + should_round_up = + fractional_part >= fractional_part_rounding_thresholds( + 8 - number_of_digits_to_print) || + ((fractional_part >> 31) & + ((digits & 1) | (third_subsegment != 0) | + has_more_segments)) != 0; } // Rounding at the subsegment boundary. else { @@ -4198,14 +4198,12 @@ template struct formatter> : formatter { } }; -template -struct nested_view { +template struct nested_view { const formatter* fmt; const T* value; }; -template -struct formatter> { +template struct formatter> { FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> const char* { return ctx.begin(); } @@ -4215,8 +4213,7 @@ struct formatter> { } }; -template -struct nested_formatter { +template struct nested_formatter { private: int width_; detail::fill_t fill_; @@ -4226,8 +4223,8 @@ struct nested_formatter { public: FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> const char* { auto specs = detail::dynamic_format_specs(); - auto it = parse_format_specs( - ctx.begin(), ctx.end(), specs, ctx, detail::type::none_type); + auto it = parse_format_specs(ctx.begin(), ctx.end(), specs, ctx, + detail::type::none_type); width_ = specs.width; fill_ = specs.fill; align_ = specs.align;