Skip to content

Commit 28e07bc

Browse files
authored
Fixed minor code smells (yhirose#901)
1 parent faa5f1d commit 28e07bc

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

example/ssesvr.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ using namespace std;
2020
class EventDispatcher {
2121
public:
2222
EventDispatcher() {
23-
id_ = 0;
24-
cid_ = -1;
2523
}
2624

2725
void wait_event(DataSink *sink) {
@@ -41,8 +39,8 @@ class EventDispatcher {
4139
private:
4240
mutex m_;
4341
condition_variable cv_;
44-
atomic_int id_;
45-
atomic_int cid_;
42+
atomic_int id_ = 0;
43+
atomic_int cid_ = -1;
4644
string message_;
4745
};
4846

httplib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ struct Request {
395395
ContentReceiverWithProgress content_receiver;
396396
Progress progress;
397397
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
398-
const SSL *ssl;
398+
const SSL *ssl = nullptr;
399399
#endif
400400

401401
bool has_header(const char *key) const;
@@ -786,7 +786,7 @@ class Server {
786786
SocketOptions socket_options_ = default_socket_options;
787787
};
788788

789-
enum Error {
789+
enum class Error {
790790
Success = 0,
791791
Unknown,
792792
Connection,

0 commit comments

Comments
 (0)