zeroconf/avahi/Poll: add constexpr

This commit is contained in:
Max Kellermann 2021-02-22 14:34:24 +01:00
parent 1f08d2d03c
commit 7ec4de841e

View File

@ -22,14 +22,14 @@
#include "event/CoarseTimerEvent.hxx" #include "event/CoarseTimerEvent.hxx"
#include "time/Convert.hxx" #include "time/Convert.hxx"
static unsigned static constexpr unsigned
FromAvahiWatchEvent(AvahiWatchEvent e) noexcept FromAvahiWatchEvent(AvahiWatchEvent e) noexcept
{ {
return (e & AVAHI_WATCH_IN ? SocketEvent::READ : 0) | return (e & AVAHI_WATCH_IN ? SocketEvent::READ : 0) |
(e & AVAHI_WATCH_OUT ? SocketEvent::WRITE : 0); (e & AVAHI_WATCH_OUT ? SocketEvent::WRITE : 0);
} }
static AvahiWatchEvent static constexpr AvahiWatchEvent
ToAvahiWatchEvent(unsigned e) noexcept ToAvahiWatchEvent(unsigned e) noexcept
{ {
return AvahiWatchEvent((e & SocketEvent::READ ? AVAHI_WATCH_IN : 0) | return AvahiWatchEvent((e & SocketEvent::READ ? AVAHI_WATCH_IN : 0) |