From 5ca0b7a28f761c21943350a64d4c742d7cb53e80 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 21 Aug 2018 18:24:30 +0200 Subject: [PATCH] fs/io/FileReader: add "noexcept" --- src/fs/io/FileReader.cxx | 4 ++-- src/fs/io/FileReader.hxx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fs/io/FileReader.cxx b/src/fs/io/FileReader.cxx index 42adab501..afc4e701c 100644 --- a/src/fs/io/FileReader.cxx +++ b/src/fs/io/FileReader.cxx @@ -78,7 +78,7 @@ FileReader::Skip(off_t offset) } void -FileReader::Close() +FileReader::Close() noexcept { assert(IsDefined()); @@ -144,7 +144,7 @@ FileReader::Skip(off_t offset) } void -FileReader::Close() +FileReader::Close() noexcept { assert(IsDefined()); diff --git a/src/fs/io/FileReader.hxx b/src/fs/io/FileReader.hxx index 03a2ac8f8..a537e6c68 100644 --- a/src/fs/io/FileReader.hxx +++ b/src/fs/io/FileReader.hxx @@ -47,27 +47,27 @@ public: explicit FileReader(Path _path); #ifdef _WIN32 - FileReader(FileReader &&other) + FileReader(FileReader &&other) noexcept :path(std::move(other.path)), handle(other.handle) { other.handle = INVALID_HANDLE_VALUE; } #else - FileReader(FileReader &&other) + FileReader(FileReader &&other) noexcept :path(std::move(other.path)), fd(other.fd) { other.fd.SetUndefined(); } #endif - ~FileReader() { + ~FileReader() noexcept { if (IsDefined()) Close(); } protected: - bool IsDefined() const { + bool IsDefined() const noexcept { #ifdef _WIN32 return handle != INVALID_HANDLE_VALUE; #else @@ -77,12 +77,12 @@ protected: public: #ifndef _WIN32 - FileDescriptor GetFD() const { + FileDescriptor GetFD() const noexcept { return fd; } #endif - void Close(); + void Close() noexcept; FileInfo GetFileInfo() const;