From 451fbbcea1ef7b55004a3392eab0dcffe1963fcc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Dec 2017 10:44:47 +0100 Subject: [PATCH] event/FullyBufferedSocket: add "noexcept" --- src/event/FullyBufferedSocket.cxx | 6 +++--- src/event/FullyBufferedSocket.hxx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/event/FullyBufferedSocket.cxx b/src/event/FullyBufferedSocket.cxx index bcfd24d31..9fb588931 100644 --- a/src/event/FullyBufferedSocket.cxx +++ b/src/event/FullyBufferedSocket.cxx @@ -26,7 +26,7 @@ #include FullyBufferedSocket::ssize_t -FullyBufferedSocket::DirectWrite(const void *data, size_t length) +FullyBufferedSocket::DirectWrite(const void *data, size_t length) noexcept { const auto nbytes = GetSocket().Write((const char *)data, length); if (gcc_unlikely(nbytes < 0)) { @@ -47,7 +47,7 @@ FullyBufferedSocket::DirectWrite(const void *data, size_t length) } bool -FullyBufferedSocket::Flush() +FullyBufferedSocket::Flush() noexcept { assert(IsDefined()); @@ -73,7 +73,7 @@ FullyBufferedSocket::Flush() } bool -FullyBufferedSocket::Write(const void *data, size_t length) +FullyBufferedSocket::Write(const void *data, size_t length) noexcept { assert(IsDefined()); diff --git a/src/event/FullyBufferedSocket.hxx b/src/event/FullyBufferedSocket.hxx index 4fd2a4d0e..f40c1e828 100644 --- a/src/event/FullyBufferedSocket.hxx +++ b/src/event/FullyBufferedSocket.hxx @@ -33,20 +33,20 @@ class FullyBufferedSocket : protected BufferedSocket, private IdleMonitor { public: FullyBufferedSocket(SocketDescriptor _fd, EventLoop &_loop, - size_t normal_size, size_t peak_size=0) + size_t normal_size, size_t peak_size=0) noexcept :BufferedSocket(_fd, _loop), IdleMonitor(_loop), output(normal_size, peak_size) { } using BufferedSocket::IsDefined; - void Close() { + void Close() noexcept { IdleMonitor::Cancel(); BufferedSocket::Close(); } private: - ssize_t DirectWrite(const void *data, size_t length); + ssize_t DirectWrite(const void *data, size_t length) noexcept; protected: /** @@ -54,12 +54,12 @@ protected: * * @return false if the socket has been closed */ - bool Flush(); + bool Flush() noexcept; /** * @return false if the socket has been closed */ - bool Write(const void *data, size_t length); + bool Write(const void *data, size_t length) noexcept; /* virtual methods from class SocketMonitor */ bool OnSocketReady(unsigned flags) noexcept override;