diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e506b1..8fdfb69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,8 +79,8 @@ set(CMAKE_CXX_FLAGS_UBSAN CACHE STRING "Flags used by the C++ compiler during UndefinedBehaviourSanitizer builds." FORCE) -add_subdirectory(lib/) -add_subdirectory(use_case/) +add_subdirectory(lib) +add_subdirectory(use_case) if(ENABLE_TEST) enable_testing() @@ -91,9 +91,11 @@ if(ENABLE_PERFORMANCE) add_subdirectory(performance/) endif() -target_compile_options(EventBus PRIVATE +if(NOT MSVC) + target_compile_options(EventBus PRIVATE -Wall -pedantic -Wnon-virtual-dtor -Werror -Wno-error=deprecated-declarations ) +endif() \ No newline at end of file diff --git a/lib/src/dexode/EventBus.cpp b/lib/src/dexode/EventBus.cpp index 23a7868..19c37af 100644 --- a/lib/src/dexode/EventBus.cpp +++ b/lib/src/dexode/EventBus.cpp @@ -3,6 +3,8 @@ // #include "EventBus.hpp" +#include + namespace dexode { @@ -70,7 +72,7 @@ eventbus::stream::EventStream* EventBus::findStream( void EventBus::unlistenAll(const std::uint32_t listenerID) { std::shared_lock readGuard{_mutexStreams}; - for(auto& eventStream : _eventToStream) + for(const auto& eventStream : _eventToStream) { eventStream.second->removeListener(listenerID); } @@ -120,7 +122,7 @@ eventbus::stream::EventStream* EventBus::listen(const std::uint32_t, void EventBus::unlisten(const std::uint32_t listenerID, const eventbus::internal::event_id_t eventID) { - auto* eventStream = findStream(eventID); + eventbus::stream::EventStream* eventStream = findStream(eventID); if(eventStream != nullptr) { eventStream->removeListener(listenerID); diff --git a/lib/src/dexode/eventbus/stream/ProtectedEventStream.hpp b/lib/src/dexode/eventbus/stream/ProtectedEventStream.hpp index 63fcb87..c4ea191 100644 --- a/lib/src/dexode/eventbus/stream/ProtectedEventStream.hpp +++ b/lib/src/dexode/eventbus/stream/ProtectedEventStream.hpp @@ -3,8 +3,9 @@ #include #include #include -#include +#include #include +#include #include "dexode/eventbus/stream/EventStream.hpp"