Apply clang-format

This commit is contained in:
Victor Zverovich 2023-09-22 09:07:43 -07:00
parent 7529af8f99
commit 649f2460db

View File

@ -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 <typename T, bool doublish = num_bits<T>() == num_bits<double>()>
using convert_float_result =
conditional_t<std::is_same<T, float>::value || doublish, double, T>;
@ -3160,8 +3159,10 @@ FMT_CONSTEXPR20 inline void format_dragon(basic_fp<uint128_t> 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 <typename Float>
FMT_CONSTEXPR20 auto format_float(Float value, int precision, float_specs specs,
buffer<char>& buf) -> int {
// float is passed as double to reduce the number of instantiations.
static_assert(!std::is_same<Float, float>::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<uint32_t>(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<uint32_t>(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 <typename T> struct formatter<group_digits_view<T>> : formatter<T> {
}
};
template <typename T>
struct nested_view {
template <typename T> struct nested_view {
const formatter<T>* fmt;
const T* value;
};
template <typename T>
struct formatter<nested_view<T>> {
template <typename T> struct formatter<nested_view<T>> {
FMT_CONSTEXPR auto parse(format_parse_context& ctx) -> const char* {
return ctx.begin();
}
@ -4215,8 +4213,7 @@ struct formatter<nested_view<T>> {
}
};
template <typename T>
struct nested_formatter {
template <typename T> struct nested_formatter {
private:
int width_;
detail::fill_t<char> 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<char>();
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;