From 0405a57f262e5f713722f590421df9f335792bb0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 Feb 2021 14:51:46 +0100 Subject: [PATCH] zeroconf/avahi/Poll: make EventLoop the first parameter --- src/zeroconf/avahi/Poll.cxx | 18 ++++++++---------- 1 file 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); }