clang-format

This commit is contained in:
gabime 2019-06-18 17:05:27 +03:00
parent 38888ba5b3
commit 78c833a09f
8 changed files with 208 additions and 223 deletions

View File

@ -26,13 +26,11 @@
#include <windows.h> #include <windows.h>
#endif //_WIN32 #endif //_WIN32
#if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) #if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
#include <codecvt> #include <codecvt>
#include <locale> #include <locale>
#endif #endif
#ifdef SPDLOG_COMPILED_LIB #ifdef SPDLOG_COMPILED_LIB
#undef SPDLOG_HEADER_ONLY #undef SPDLOG_HEADER_ONLY
#define SPDLOG_INLINE #define SPDLOG_INLINE

View File

@ -6,7 +6,6 @@
#include "spdlog/details/null_mutex.h" #include "spdlog/details/null_mutex.h"
#include <mutex> #include <mutex>
namespace spdlog { namespace spdlog {
namespace details { namespace details {

View File

@ -13,24 +13,21 @@
namespace spdlog { namespace spdlog {
// public methods // public methods
SPDLOG_INLINE logger::logger(const logger &other): SPDLOG_INLINE logger::logger(const logger &other)
name_(other.name_), : name_(other.name_)
sinks_(other.sinks_), , sinks_(other.sinks_)
level_(other.level_.load(std::memory_order_relaxed)), , level_(other.level_.load(std::memory_order_relaxed))
flush_level_(other.flush_level_.load(std::memory_order_relaxed)), , flush_level_(other.flush_level_.load(std::memory_order_relaxed))
custom_err_handler_(other.custom_err_handler_) , custom_err_handler_(other.custom_err_handler_)
{ {}
}
SPDLOG_INLINE logger::logger(logger &&other):
name_(std::move(other.name_)),
sinks_(std::move(other.sinks_)),
level_(other.level_.load(std::memory_order_relaxed)),
flush_level_(other.flush_level_.load(std::memory_order_relaxed)),
custom_err_handler_(std::move(other.custom_err_handler_))
{
}
SPDLOG_INLINE logger::logger(logger &&other)
: name_(std::move(other.name_))
, sinks_(std::move(other.sinks_))
, level_(other.level_.load(std::memory_order_relaxed))
, flush_level_(other.flush_level_.load(std::memory_order_relaxed))
, custom_err_handler_(std::move(other.custom_err_handler_))
{}
SPDLOG_INLINE logger &logger::operator=(logger other) SPDLOG_INLINE logger &logger::operator=(logger other)
{ {
@ -56,7 +53,6 @@ namespace spdlog {
custom_err_handler_.swap(other.custom_err_handler_); custom_err_handler_.swap(other.custom_err_handler_);
} }
SPDLOG_INLINE void swap(logger &a, logger &b) SPDLOG_INLINE void swap(logger &a, logger &b)
{ {
a.swap(b); a.swap(b);

View File

@ -350,7 +350,6 @@ void swap(logger& a, logger& b);
} // namespace spdlog } // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY #ifdef SPDLOG_HEADER_ONLY
#include "logger-inl.h" #include "logger-inl.h"
#endif #endif

View File

@ -77,7 +77,6 @@ private:
void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end); void print_range_(const fmt::memory_buffer &formatted, size_t start, size_t end);
}; };
template<typename ConsoleMutex> template<typename ConsoleMutex>
class ansicolor_stdout_sink : public ansicolor_sink<ConsoleMutex> class ansicolor_stdout_sink : public ansicolor_sink<ConsoleMutex>
{ {
@ -92,7 +91,6 @@ public:
explicit ansicolor_stderr_sink(color_mode mode = color_mode::automatic); explicit ansicolor_stderr_sink(color_mode mode = color_mode::automatic);
}; };
using ansicolor_stdout_sink_mt = ansicolor_stdout_sink<details::console_mutex>; using ansicolor_stdout_sink_mt = ansicolor_stdout_sink<details::console_mutex>;
using ansicolor_stdout_sink_st = ansicolor_stdout_sink<details::console_nullmutex>; using ansicolor_stdout_sink_st = ansicolor_stdout_sink<details::console_nullmutex>;

View File

@ -125,7 +125,6 @@ void SPDLOG_INLINE wincolor_sink<ConsoleMutex>::print_range_(const fmt::memory_b
::WriteConsoleA(out_handle_, formatted.data() + start, size, nullptr, nullptr); ::WriteConsoleA(out_handle_, formatted.data() + start, size, nullptr, nullptr);
} }
// wincolor_stdout_sink // wincolor_stdout_sink
template<typename ConsoleMutex> template<typename ConsoleMutex>
SPDLOG_INLINE wincolor_stdout_sink<ConsoleMutex>::wincolor_stdout_sink(color_mode mode) SPDLOG_INLINE wincolor_stdout_sink<ConsoleMutex>::wincolor_stdout_sink(color_mode mode)
@ -138,6 +137,5 @@ SPDLOG_INLINE wincolor_stderr_sink<ConsoleMutex>::wincolor_stderr_sink(color_mod
: wincolor_sink<ConsoleMutex>(::GetStdHandle(STD_ERROR_HANDLE), mode) : wincolor_sink<ConsoleMutex>(::GetStdHandle(STD_ERROR_HANDLE), mode)
{} {}
} // namespace sinks } // namespace sinks
} // namespace spdlog } // namespace spdlog

View File

@ -264,8 +264,6 @@ static const char *test_path = "\\a\\b\\myfile.cpp";
static const char *test_path = "/a/b//myfile.cpp"; static const char *test_path = "/a/b//myfile.cpp";
#endif #endif
TEST_CASE("short filename formatter-1", "[pattern_formatter]") TEST_CASE("short filename formatter-1", "[pattern_formatter]")
{ {
spdlog::pattern_formatter formatter("%s", spdlog::pattern_time_type::local, ""); spdlog::pattern_formatter formatter("%s", spdlog::pattern_time_type::local, "");
@ -309,4 +307,3 @@ TEST_CASE("full filename formatter", "[pattern_formatter]")
formatter.format(msg, formatted); formatter.format(msg, formatted);
REQUIRE(fmt::to_string(formatted) == test_path); REQUIRE(fmt::to_string(formatted) == test_path);
} }