forked from fmtlib/fmt
Apply clang-format
This commit is contained in:
@@ -725,7 +725,8 @@ struct type_constant : std::integral_constant<type, type::custom_type> {};
|
|||||||
|
|
||||||
#define FMT_TYPE_CONSTANT(Type, constant) \
|
#define FMT_TYPE_CONSTANT(Type, constant) \
|
||||||
template <typename Char> \
|
template <typename Char> \
|
||||||
struct type_constant<Type, Char> : std::integral_constant<type, type::constant> {}
|
struct type_constant<Type, Char> \
|
||||||
|
: std::integral_constant<type, type::constant> {}
|
||||||
|
|
||||||
FMT_TYPE_CONSTANT(const named_arg_base<Char>&, named_arg_type);
|
FMT_TYPE_CONSTANT(const named_arg_base<Char>&, named_arg_type);
|
||||||
FMT_TYPE_CONSTANT(int, int_type);
|
FMT_TYPE_CONSTANT(int, int_type);
|
||||||
|
@@ -406,8 +406,9 @@ basic_printf_context<OutputIt, Char>::get_arg(int arg_index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename OutputIt, typename Char>
|
template <typename OutputIt, typename Char>
|
||||||
int basic_printf_context<OutputIt, Char>::parse_header(
|
int basic_printf_context<OutputIt, Char>::parse_header(const Char*& it,
|
||||||
const Char*& it, const Char* end, format_specs& specs) {
|
const Char* end,
|
||||||
|
format_specs& specs) {
|
||||||
int arg_index = -1;
|
int arg_index = -1;
|
||||||
char_type c = *it;
|
char_type c = *it;
|
||||||
if (c >= '0' && c <= '9') {
|
if (c >= '0' && c <= '9') {
|
||||||
@@ -476,8 +477,8 @@ OutputIt basic_printf_context<OutputIt, Char>::format() {
|
|||||||
specs.precision = parse_nonnegative_int(it, end, eh);
|
specs.precision = parse_nonnegative_int(it, end, eh);
|
||||||
} else if (c == '*') {
|
} else if (c == '*') {
|
||||||
++it;
|
++it;
|
||||||
specs.precision =
|
specs.precision = static_cast<int>(
|
||||||
static_cast<int>(visit_format_arg(internal::printf_precision_handler(), get_arg()));
|
visit_format_arg(internal::printf_precision_handler(), get_arg()));
|
||||||
} else {
|
} else {
|
||||||
specs.precision = 0;
|
specs.precision = 0;
|
||||||
}
|
}
|
||||||
|
@@ -457,7 +457,8 @@ TEST(CoreTest, HasFormatter) {
|
|||||||
using context = fmt::format_context;
|
using context = fmt::format_context;
|
||||||
static_assert(has_formatter<enabled_formatter, context>::value, "");
|
static_assert(has_formatter<enabled_formatter, context>::value, "");
|
||||||
static_assert(!has_formatter<disabled_formatter, context>::value, "");
|
static_assert(!has_formatter<disabled_formatter, context>::value, "");
|
||||||
static_assert(!has_formatter<disabled_formatter_convertible, context>::value, "");
|
static_assert(!has_formatter<disabled_formatter_convertible, context>::value,
|
||||||
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
struct convertible_to_int {
|
struct convertible_to_int {
|
||||||
|
@@ -272,8 +272,8 @@ TEST(FPTest, GetCachedPower) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(FPTest, GetRoundDirection) {
|
TEST(FPTest, GetRoundDirection) {
|
||||||
using fmt::internal::round_direction;
|
|
||||||
using fmt::internal::get_round_direction;
|
using fmt::internal::get_round_direction;
|
||||||
|
using fmt::internal::round_direction;
|
||||||
EXPECT_EQ(round_direction::down, get_round_direction(100, 50, 0));
|
EXPECT_EQ(round_direction::down, get_round_direction(100, 50, 0));
|
||||||
EXPECT_EQ(round_direction::up, get_round_direction(100, 51, 0));
|
EXPECT_EQ(round_direction::up, get_round_direction(100, 51, 0));
|
||||||
EXPECT_EQ(round_direction::down, get_round_direction(100, 40, 10));
|
EXPECT_EQ(round_direction::down, get_round_direction(100, 40, 10));
|
||||||
@@ -448,8 +448,8 @@ TEST(UtilTest, CountDigits) {
|
|||||||
TEST(UtilTest, WriteUIntPtr) {
|
TEST(UtilTest, WriteUIntPtr) {
|
||||||
fmt::memory_buffer buf;
|
fmt::memory_buffer buf;
|
||||||
fmt::internal::writer writer(buf);
|
fmt::internal::writer writer(buf);
|
||||||
writer.write_pointer(fmt::internal::fallback_uintptr(
|
writer.write_pointer(
|
||||||
reinterpret_cast<void*>(0xface)),
|
fmt::internal::fallback_uintptr(reinterpret_cast<void*>(0xface)),
|
||||||
nullptr);
|
nullptr);
|
||||||
EXPECT_EQ("0xface", to_string(buf));
|
EXPECT_EQ("0xface", to_string(buf));
|
||||||
}
|
}
|
||||||
|
@@ -590,7 +590,8 @@ class custom_printf_arg_formatter : public formatter_t {
|
|||||||
if (round(value * pow(10, specs()->precision)) == 0.0) value = 0;
|
if (round(value * pow(10, specs()->precision)) == 0.0) value = 0;
|
||||||
return formatter_t::operator()(value);
|
return formatter_t::operator()(value);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
;
|
||||||
|
|
||||||
typedef fmt::basic_format_args<context_t> format_args_t;
|
typedef fmt::basic_format_args<context_t> format_args_t;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user