diff options
author | Max Kellermann <max@musicpd.org> | 2017-05-08 14:44:49 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-05-08 14:44:49 +0200 |
commit | 71f0ed8b7499011b53f90998ebfbd3250fd80948 (patch) | |
tree | e9c2f66fbef231858f46d878864199d46e6ce21c /src/archive | |
parent | ac2e4e593d407e41db49fdb9ae2da6bc1557f618 (diff) |
*: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
Diffstat (limited to 'src/archive')
-rw-r--r-- | src/archive/ArchiveLookup.cxx | 4 | ||||
-rw-r--r-- | src/archive/plugins/Bzip2ArchivePlugin.cxx | 4 | ||||
-rw-r--r-- | src/archive/plugins/Iso9660ArchivePlugin.cxx | 4 | ||||
-rw-r--r-- | src/archive/plugins/ZzipArchivePlugin.cxx | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/archive/ArchiveLookup.cxx b/src/archive/ArchiveLookup.cxx index 07b73e147..f84d97f23 100644 --- a/src/archive/ArchiveLookup.cxx +++ b/src/archive/ArchiveLookup.cxx @@ -28,7 +28,7 @@ gcc_pure static char * -FindSlash(char *p, size_t i) +FindSlash(char *p, size_t i) noexcept { for (; i > 0; --i) if (p[i] == '/') @@ -39,7 +39,7 @@ FindSlash(char *p, size_t i) gcc_pure static const char * -FindSuffix(const char *p, const char *i) +FindSuffix(const char *p, const char *i) noexcept { for (; i > p; --i) { if (*i == '.') diff --git a/src/archive/plugins/Bzip2ArchivePlugin.cxx b/src/archive/plugins/Bzip2ArchivePlugin.cxx index ee22290c2..3dc0b51c3 100644 --- a/src/archive/plugins/Bzip2ArchivePlugin.cxx +++ b/src/archive/plugins/Bzip2ArchivePlugin.cxx @@ -93,7 +93,7 @@ public: ~Bzip2InputStream(); /* virtual methods from InputStream */ - bool IsEOF() override; + bool IsEOF() noexcept override; size_t Read(void *ptr, size_t size) override; private: @@ -205,7 +205,7 @@ Bzip2InputStream::Read(void *ptr, size_t length) } bool -Bzip2InputStream::IsEOF() +Bzip2InputStream::IsEOF() noexcept { return eof; } diff --git a/src/archive/plugins/Iso9660ArchivePlugin.cxx b/src/archive/plugins/Iso9660ArchivePlugin.cxx index 7139da32d..9e4c4f16a 100644 --- a/src/archive/plugins/Iso9660ArchivePlugin.cxx +++ b/src/archive/plugins/Iso9660ArchivePlugin.cxx @@ -162,7 +162,7 @@ public: } /* virtual methods from InputStream */ - bool IsEOF() override; + bool IsEOF() noexcept override; size_t Read(void *ptr, size_t size) override; }; @@ -213,7 +213,7 @@ Iso9660InputStream::Read(void *ptr, size_t read_size) } bool -Iso9660InputStream::IsEOF() +Iso9660InputStream::IsEOF() noexcept { return offset == size; } diff --git a/src/archive/plugins/ZzipArchivePlugin.cxx b/src/archive/plugins/ZzipArchivePlugin.cxx index f9b2b3010..5ba087f48 100644 --- a/src/archive/plugins/ZzipArchivePlugin.cxx +++ b/src/archive/plugins/ZzipArchivePlugin.cxx @@ -116,7 +116,7 @@ struct ZzipInputStream final : public InputStream { } /* virtual methods from InputStream */ - bool IsEOF() override; + bool IsEOF() noexcept override; size_t Read(void *ptr, size_t size) override; void Seek(offset_type offset) override; }; @@ -147,7 +147,7 @@ ZzipInputStream::Read(void *ptr, size_t read_size) } bool -ZzipInputStream::IsEOF() +ZzipInputStream::IsEOF() noexcept { return offset_type(zzip_tell(file)) == size; } |