Commit 81350d65 authored by Max Kellermann's avatar Max Kellermann

event/SocketMonitor: use C++11 initializers

parent 02642a64
...@@ -45,13 +45,13 @@ class EventLoop; ...@@ -45,13 +45,13 @@ class EventLoop;
* as thread-safe. * as thread-safe.
*/ */
class SocketMonitor { class SocketMonitor {
SocketDescriptor fd; SocketDescriptor fd = SocketDescriptor::Undefined();
EventLoop &loop; EventLoop &loop;
/** /**
* A bit mask of events that is currently registered in the EventLoop. * A bit mask of events that is currently registered in the EventLoop.
*/ */
unsigned scheduled_flags; unsigned scheduled_flags = 0;
public: public:
static constexpr unsigned READ = PollGroup::READ; static constexpr unsigned READ = PollGroup::READ;
...@@ -62,10 +62,10 @@ public: ...@@ -62,10 +62,10 @@ public:
typedef std::make_signed<size_t>::type ssize_t; typedef std::make_signed<size_t>::type ssize_t;
SocketMonitor(EventLoop &_loop) SocketMonitor(EventLoop &_loop)
:fd(-1), loop(_loop), scheduled_flags(0) {} :loop(_loop) {}
SocketMonitor(SocketDescriptor _fd, EventLoop &_loop) SocketMonitor(SocketDescriptor _fd, EventLoop &_loop)
:fd(_fd), loop(_loop), scheduled_flags(0) {} :fd(_fd), loop(_loop) {}
~SocketMonitor(); ~SocketMonitor();
......
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