Skip to content

Commit

Permalink
Apply clang-format-17.
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
  • Loading branch information
phprus committed Dec 17, 2023
1 parent 3f099af commit 36d8b67
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,7 @@ template <typename OutputIt, typename UInt, typename Char>
auto write_int(OutputIt out, UInt value, unsigned prefix,
const format_specs<Char>& specs,
const digit_grouping<Char>& grouping) -> OutputIt {
static_assert(std::is_same<uint64_or_128_t<UInt>, UInt>::value, "");
static_assert(std::is_same<uint64_or_128_t<UInt>, UInt>::value, "");
int num_digits = 0;
auto buffer = memory_buffer();
switch (specs.type) {
Expand All @@ -2139,7 +2139,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
if (specs.alt)
prefix_append(prefix, unsigned(upper ? 'X' : 'x') << 8 | '0');
num_digits = count_digits<4>(value);
format_uint<4,Char>(appender(buffer), value, num_digits, upper);
format_uint<4, Char>(appender(buffer), value, num_digits, upper);
break;
}
case presentation_type::bin_lower:
Expand All @@ -2148,7 +2148,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
if (specs.alt)
prefix_append(prefix, unsigned(upper ? 'B' : 'b') << 8 | '0');
num_digits = count_digits<1>(value);
format_uint<1,Char>(appender(buffer), value, num_digits);
format_uint<1, Char>(appender(buffer), value, num_digits);
break;
}
case presentation_type::oct: {
Expand All @@ -2157,7 +2157,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
// is not greater than the number of digits.
if (specs.alt && specs.precision <= num_digits && value != 0)
prefix_append(prefix, '0');
format_uint<3,Char>(appender(buffer), value, num_digits);
format_uint<3, Char>(appender(buffer), value, num_digits);
break;
}
case presentation_type::chr:
Expand All @@ -2167,11 +2167,11 @@ auto write_int(OutputIt out, UInt value, unsigned prefix,
}

unsigned size = (prefix != 0 ? prefix >> 24 : 0) + to_unsigned(num_digits) +
to_unsigned(grouping.count_separators(num_digits));
to_unsigned(grouping.count_separators(num_digits));
return write_padded<align::right>(
out, specs, size, size, [&](reserve_iterator<OutputIt> it) {
for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8)
*it++ = static_cast<Char>(p & 0xff);
for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8)
*it++ = static_cast<Char>(p & 0xff);
return grouping.apply(it, string_view(buffer.data(), buffer.size()));
});
}
Expand Down

0 comments on commit 36d8b67

Please sign in to comment.