diff --git a/include/fmt/core.h b/include/fmt/core.h index f71e00b6..fbd9049e 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -728,9 +728,9 @@ template class buffer_appender : public std::back_insert_iterator> { public: explicit buffer_appender(buffer& buf) - : std::back_insert_iterator>(buf) {} + : std::back_insert_iterator>(buf) {} buffer_appender(std::back_insert_iterator> it) - : std::back_insert_iterator>(it) {} + : std::back_insert_iterator>(it) {} }; // Extracts a reference to the container from back_insert_iterator. diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index a0423c7f..39924263 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -242,26 +242,23 @@ template <> FMT_FUNC int count_digits<4>(detail::fallback_uintptr n) { template const typename basic_data::digit_pair basic_data::digits[] = { - {'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, - {'0', '5'}, {'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, - {'1', '0'}, {'1', '1'}, {'1', '2'}, {'1', '3'}, {'1', '4'}, - {'1', '5'}, {'1', '6'}, {'1', '7'}, {'1', '8'}, {'1', '9'}, - {'2', '0'}, {'2', '1'}, {'2', '2'}, {'2', '3'}, {'2', '4'}, - {'2', '5'}, {'2', '6'}, {'2', '7'}, {'2', '8'}, {'2', '9'}, - {'3', '0'}, {'3', '1'}, {'3', '2'}, {'3', '3'}, {'3', '4'}, - {'3', '5'}, {'3', '6'}, {'3', '7'}, {'3', '8'}, {'3', '9'}, - {'4', '0'}, {'4', '1'}, {'4', '2'}, {'4', '3'}, {'4', '4'}, - {'4', '5'}, {'4', '6'}, {'4', '7'}, {'4', '8'}, {'4', '9'}, - {'5', '0'}, {'5', '1'}, {'5', '2'}, {'5', '3'}, {'5', '4'}, - {'5', '5'}, {'5', '6'}, {'5', '7'}, {'5', '8'}, {'5', '9'}, - {'6', '0'}, {'6', '1'}, {'6', '2'}, {'6', '3'}, {'6', '4'}, - {'6', '5'}, {'6', '6'}, {'6', '7'}, {'6', '8'}, {'6', '9'}, - {'7', '0'}, {'7', '1'}, {'7', '2'}, {'7', '3'}, {'7', '4'}, - {'7', '5'}, {'7', '6'}, {'7', '7'}, {'7', '8'}, {'7', '9'}, - {'8', '0'}, {'8', '1'}, {'8', '2'}, {'8', '3'}, {'8', '4'}, - {'8', '5'}, {'8', '6'}, {'8', '7'}, {'8', '8'}, {'8', '9'}, - {'9', '0'}, {'9', '1'}, {'9', '2'}, {'9', '3'}, {'9', '4'}, - {'9', '5'}, {'9', '6'}, {'9', '7'}, {'9', '8'}, {'9', '9'}}; + {'0', '0'}, {'0', '1'}, {'0', '2'}, {'0', '3'}, {'0', '4'}, {'0', '5'}, + {'0', '6'}, {'0', '7'}, {'0', '8'}, {'0', '9'}, {'1', '0'}, {'1', '1'}, + {'1', '2'}, {'1', '3'}, {'1', '4'}, {'1', '5'}, {'1', '6'}, {'1', '7'}, + {'1', '8'}, {'1', '9'}, {'2', '0'}, {'2', '1'}, {'2', '2'}, {'2', '3'}, + {'2', '4'}, {'2', '5'}, {'2', '6'}, {'2', '7'}, {'2', '8'}, {'2', '9'}, + {'3', '0'}, {'3', '1'}, {'3', '2'}, {'3', '3'}, {'3', '4'}, {'3', '5'}, + {'3', '6'}, {'3', '7'}, {'3', '8'}, {'3', '9'}, {'4', '0'}, {'4', '1'}, + {'4', '2'}, {'4', '3'}, {'4', '4'}, {'4', '5'}, {'4', '6'}, {'4', '7'}, + {'4', '8'}, {'4', '9'}, {'5', '0'}, {'5', '1'}, {'5', '2'}, {'5', '3'}, + {'5', '4'}, {'5', '5'}, {'5', '6'}, {'5', '7'}, {'5', '8'}, {'5', '9'}, + {'6', '0'}, {'6', '1'}, {'6', '2'}, {'6', '3'}, {'6', '4'}, {'6', '5'}, + {'6', '6'}, {'6', '7'}, {'6', '8'}, {'6', '9'}, {'7', '0'}, {'7', '1'}, + {'7', '2'}, {'7', '3'}, {'7', '4'}, {'7', '5'}, {'7', '6'}, {'7', '7'}, + {'7', '8'}, {'7', '9'}, {'8', '0'}, {'8', '1'}, {'8', '2'}, {'8', '3'}, + {'8', '4'}, {'8', '5'}, {'8', '6'}, {'8', '7'}, {'8', '8'}, {'8', '9'}, + {'9', '0'}, {'9', '1'}, {'9', '2'}, {'9', '3'}, {'9', '4'}, {'9', '5'}, + {'9', '6'}, {'9', '7'}, {'9', '8'}, {'9', '9'}}; template const char basic_data::hex_digits[] = "0123456789abcdef"; diff --git a/include/fmt/os.h b/include/fmt/os.h index a9517ef8..ebe32243 100644 --- a/include/fmt/os.h +++ b/include/fmt/os.h @@ -346,8 +346,7 @@ long getpagesize(); class direct_buffered_file; template -void print(direct_buffered_file& f, const S& format_str, - const Args&... args); +void print(direct_buffered_file& f, const S& format_str, const Args&... args); // A buffered file with a direct buffer access and no synchronization. class direct_buffered_file { @@ -368,11 +367,9 @@ class direct_buffered_file { public: direct_buffered_file(cstring_view path, int oflag) - : file_(path, oflag), pos_(0) {} + : file_(path, oflag), pos_(0) {} - ~direct_buffered_file() { - flush(); - } + ~direct_buffered_file() { flush(); } void close() { flush(); diff --git a/test/core-test.cc b/test/core-test.cc index 2655d78c..c53466ff 100644 --- a/test/core-test.cc +++ b/test/core-test.cc @@ -375,8 +375,8 @@ struct check_custom { void grow(size_t) {} } buffer; fmt::format_parse_context parse_ctx(""); - fmt::format_context ctx{ - fmt::detail::buffer_appender(buffer), fmt::format_args()}; + fmt::format_context ctx{fmt::detail::buffer_appender(buffer), + fmt::format_args()}; h.format(parse_ctx, ctx); EXPECT_EQ("test", std::string(buffer.data, buffer.size())); return test_result(); @@ -386,7 +386,7 @@ struct check_custom { TEST(ArgTest, CustomArg) { test_struct test; using visitor = - mock_visitor::handle>; + mock_visitor::handle>; testing::StrictMock v; EXPECT_CALL(v, visit(_)).WillOnce(testing::Invoke(check_custom())); fmt::visit_format_arg(v, make_arg(test)); diff --git a/test/custom-formatter-test.cc b/test/custom-formatter-test.cc index f378bd78..69d21d05 100644 --- a/test/custom-formatter-test.cc +++ b/test/custom-formatter-test.cc @@ -24,8 +24,7 @@ class custom_arg_formatter custom_arg_formatter(fmt::format_context& ctx, fmt::format_parse_context* parse_ctx, - fmt::format_specs* s = nullptr, - const char* = nullptr) + fmt::format_specs* s = nullptr, const char* = nullptr) : base(ctx, parse_ctx, s) {} using base::operator(); @@ -41,7 +40,7 @@ std::string custom_vformat(fmt::string_view format_str, fmt::format_args args) { fmt::memory_buffer buffer; // Pass custom argument formatter as a template arg to vwrite. fmt::vformat_to( - fmt::detail::buffer_appender(buffer), format_str, args); + fmt::detail::buffer_appender(buffer), format_str, args); return std::string(buffer.data(), buffer.size()); } diff --git a/test/os-test.cc b/test/os-test.cc index 186198ef..faf0a0d8 100644 --- a/test/os-test.cc +++ b/test/os-test.cc @@ -288,8 +288,8 @@ TEST(BufferedFileTest, Fileno) { } TEST(DirectBufferedFileTest, Print) { - fmt::direct_buffered_file out( - "test-file", fmt::file::WRONLY | fmt::file::CREATE); + fmt::direct_buffered_file out("test-file", + fmt::file::WRONLY | fmt::file::CREATE); fmt::print(out, "The answer is {}.\n", 42); out.close(); file in("test-file", file::RDONLY); @@ -298,8 +298,8 @@ TEST(DirectBufferedFileTest, Print) { TEST(DirectBufferedFileTest, BufferBoundary) { auto str = std::string(4096, 'x'); - fmt::direct_buffered_file out( - "test-file", fmt::file::WRONLY | fmt::file::CREATE); + fmt::direct_buffered_file out("test-file", + fmt::file::WRONLY | fmt::file::CREATE); fmt::print(out, "{}", str); fmt::print(out, "{}", str); out.close(); diff --git a/test/ostream-test.cc b/test/ostream-test.cc index fccc9b0d..3200d46d 100644 --- a/test/ostream-test.cc +++ b/test/ostream-test.cc @@ -75,8 +75,8 @@ struct test_arg_formatter TEST(OStreamTest, CustomArg) { fmt::memory_buffer buffer; - fmt::format_context ctx( - fmt::detail::buffer_appender{buffer}, fmt::format_args()); + fmt::format_context ctx(fmt::detail::buffer_appender{buffer}, + fmt::format_args()); fmt::format_specs spec; test_arg_formatter af(ctx, spec); fmt::visit_format_arg(