From 28e07bca16942bc9cd3b39ea46f8a3b01a41b91a Mon Sep 17 00:00:00 2001 From: Philipp Hasper Date: Fri, 9 Apr 2021 20:55:21 +0200 Subject: [PATCH] Fixed minor code smells (#901) --- example/ssesvr.cc | 6 ++---- httplib.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/example/ssesvr.cc b/example/ssesvr.cc index 52cf025..4a58c66 100644 --- a/example/ssesvr.cc +++ b/example/ssesvr.cc @@ -20,8 +20,6 @@ using namespace std; class EventDispatcher { public: EventDispatcher() { - id_ = 0; - cid_ = -1; } void wait_event(DataSink *sink) { @@ -41,8 +39,8 @@ public: private: mutex m_; condition_variable cv_; - atomic_int id_; - atomic_int cid_; + atomic_int id_ = 0; + atomic_int cid_ = -1; string message_; }; diff --git a/httplib.h b/httplib.h index cc8bd8d..aff843e 100644 --- a/httplib.h +++ b/httplib.h @@ -395,7 +395,7 @@ struct Request { ContentReceiverWithProgress content_receiver; Progress progress; #ifdef CPPHTTPLIB_OPENSSL_SUPPORT - const SSL *ssl; + const SSL *ssl = nullptr; #endif bool has_header(const char *key) const; @@ -786,7 +786,7 @@ private: SocketOptions socket_options_ = default_socket_options; }; -enum Error { +enum class Error { Success = 0, Unknown, Connection,