From c6bed1f464a02d3cb0895a1598a80ce9b6a4f93b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 19 Aug 2015 21:16:44 -0700 Subject: [PATCH] Dispatcher: Move several fixed initial values to header. --- src/Dispatcher.cpp | 7 +------ src/Dispatcher.h | 8 ++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Dispatcher.cpp b/src/Dispatcher.cpp index 34475561f2..7bb650a9e4 100644 --- a/src/Dispatcher.cpp +++ b/src/Dispatcher.cpp @@ -31,12 +31,7 @@ void Dispatcher::StartClient(const char* server_name, unsigned int port) { } DispatcherBase::DispatcherBase(Storage& storage, Notifier& notifier) - : m_storage(storage), - m_notifier(notifier), - m_server(false), - m_do_flush(false), - m_reconnect_proto_rev(0x0300), - m_do_reconnect(true) { + : m_storage(storage), m_notifier(notifier) { m_active = false; m_update_rate = 100; } diff --git a/src/Dispatcher.h b/src/Dispatcher.h index 36d7d96852..d90233e767 100644 --- a/src/Dispatcher.h +++ b/src/Dispatcher.h @@ -73,7 +73,7 @@ class DispatcherBase { Storage& m_storage; Notifier& m_notifier; - bool m_server; + bool m_server = false; std::string m_persist_filename; std::thread m_dispatch_thread; std::thread m_clientserver_thread; @@ -93,12 +93,12 @@ class DispatcherBase { std::mutex m_flush_mutex; std::condition_variable m_flush_cv; std::chrono::steady_clock::time_point m_last_flush; - bool m_do_flush; + bool m_do_flush = false; // Condition variable for client reconnect (uses user mutex) std::condition_variable m_reconnect_cv; - unsigned int m_reconnect_proto_rev; - bool m_do_reconnect; + unsigned int m_reconnect_proto_rev = 0x0300; + bool m_do_reconnect = true; }; class Dispatcher : public DispatcherBase {