Commit f4bbe8b2 authored by gabime's avatar gabime

Fixed some extra warnings from clang

parent e52e258f
#-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded
CXX ?= g++
CXX_FLAGS = -Wall -Wextra -pedantic -std=c++11 -pthread -I../include -fmax-errors=1 -Wconversion -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-weak-vtables -Wno-global-constructors
CXX_RELEASE_FLAGS = -O3 -march=native
CXX_DEBUG_FLAGS= -g
all: example
debug: example-debug
example: example.cpp
$(CXX) example.cpp -o example $(CXX_FLAGS) $(CXX_RELEASE_FLAGS) $(CXXFLAGS)
example-debug: example.cpp
$(CXX) example.cpp -o example-debug $(CXX_FLAGS) $(CXX_DEBUG_FLAGS) $(CXXFLAGS)
clean:
rm -f *.o logs/*.txt example example-debug
rebuild: clean all
rebuild-debug: clean debug
......@@ -198,6 +198,13 @@ private:
switch (incoming_async_msg.msg_type)
{
case async_msg_type::log:
{
log_msg msg;
incoming_async_msg.to_log_msg(msg);
incoming_async_msg.worker_ptr->backend_log_(msg);
return true;
}
case async_msg_type::flush:
{
incoming_async_msg.worker_ptr->backend_flush_();
......@@ -208,16 +215,9 @@ private:
{
return false;
}
default:
{
log_msg msg;
incoming_async_msg.to_log_msg(msg);
incoming_async_msg.worker_ptr->backend_log_(msg);
return true;
}
}
return true; // should not be reached
assert(false && "Unexpected async_msg_type");
return true;
}
};
......
......@@ -22,7 +22,9 @@ public:
explicit sink(std::unique_ptr<spdlog::pattern_formatter> formatter)
: level_(level::trace)
, formatter_(std::move(formatter)){};
, formatter_(std::move(formatter))
{
}
virtual ~sink() = default;
virtual void log(const details::log_msg &msg) = 0;
......
......@@ -92,7 +92,6 @@ TEST_CASE("periodic flush", "[periodic_flush]")
spdlog::drop_all();
}
TEST_CASE("clone", "[clone]")
{
using namespace spdlog;
......@@ -133,6 +132,5 @@ TEST_CASE("clone async", "[clone]")
auto test_sink = std::static_pointer_cast<sinks::test_sink_mt>(cloned->sinks()[0]);
REQUIRE(test_sink->msg_counter() == 2);
spdlog::drop_all();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment