diff options
author | Max Kellermann <max@musicpd.org> | 2021-02-22 14:51:46 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-02-22 14:52:21 +0100 |
commit | 0405a57f262e5f713722f590421df9f335792bb0 (patch) | |
tree | 875bea64c1adccc226ff4edeb36077229b0fa176 /src | |
parent | f29c69d6a950e15d8000407e2f682bb46233a8bb (diff) |
zeroconf/avahi/Poll: make EventLoop the first parameter
Diffstat (limited to 'src')
-rw-r--r-- | src/zeroconf/avahi/Poll.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/zeroconf/avahi/Poll.cxx b/src/zeroconf/avahi/Poll.cxx index 1b1101e6f..f0f7fda3e 100644 --- a/src/zeroconf/avahi/Poll.cxx +++ b/src/zeroconf/avahi/Poll.cxx @@ -47,9 +47,9 @@ struct AvahiWatch final { AvahiWatchEvent received; public: - AvahiWatch(SocketDescriptor _fd, AvahiWatchEvent _event, - AvahiWatchCallback _callback, void *_userdata, - EventLoop &_loop) noexcept + AvahiWatch(EventLoop &_loop, + SocketDescriptor _fd, AvahiWatchEvent _event, + AvahiWatchCallback _callback, void *_userdata) noexcept :event(_loop, BIND_THIS_METHOD(OnSocketReady), _fd), callback(_callback), userdata(_userdata), received(AvahiWatchEvent(0)) { @@ -84,9 +84,8 @@ struct AvahiTimeout final { void *const userdata; public: - AvahiTimeout(const struct timeval *tv, - AvahiTimeoutCallback _callback, void *_userdata, - EventLoop &_loop) noexcept + AvahiTimeout(EventLoop &_loop, const struct timeval *tv, + AvahiTimeoutCallback _callback, void *_userdata) noexcept :event(_loop, BIND_THIS_METHOD(OnTimeout)), callback(_callback), userdata(_userdata) { if (tv != nullptr) @@ -129,8 +128,8 @@ MyAvahiPoll::WatchNew(const AvahiPoll *api, int fd, AvahiWatchEvent event, { const MyAvahiPoll &poll = *(const MyAvahiPoll *)api; - return new AvahiWatch(SocketDescriptor(fd), event, callback, userdata, - poll.event_loop); + return new AvahiWatch(poll.event_loop, SocketDescriptor(fd), event, + callback, userdata); } AvahiTimeout * @@ -139,6 +138,5 @@ MyAvahiPoll::TimeoutNew(const AvahiPoll *api, const struct timeval *tv, { const MyAvahiPoll &poll = *(const MyAvahiPoll *)api; - return new AvahiTimeout(tv, callback, userdata, - poll.event_loop); + return new AvahiTimeout(poll.event_loop, tv, callback, userdata); } |