diff --git a/src/lib/xiph/OggPage.hxx b/src/lib/xiph/OggPage.hxx index 777246c30..ea7a539de 100644 --- a/src/lib/xiph/OggPage.hxx +++ b/src/lib/xiph/OggPage.hxx @@ -29,7 +29,7 @@ #include static size_t -ReadPage(const ogg_page &page, void *_buffer, size_t size) +ReadPage(const ogg_page &page, void *_buffer, size_t size) noexcept { assert(page.header_len > 0 || page.body_len > 0); diff --git a/src/lib/xiph/OggSerial.cxx b/src/lib/xiph/OggSerial.cxx index 2f6ba31a9..70b7fa46a 100644 --- a/src/lib/xiph/OggSerial.cxx +++ b/src/lib/xiph/OggSerial.cxx @@ -26,7 +26,7 @@ static std::atomic_uint next_ogg_serial; int -GenerateOggSerial() +GenerateOggSerial() noexcept { unsigned serial = ++next_ogg_serial; if (gcc_unlikely(serial < 16)) { diff --git a/src/lib/xiph/OggSerial.hxx b/src/lib/xiph/OggSerial.hxx index afb7c613d..eb53ff4f4 100644 --- a/src/lib/xiph/OggSerial.hxx +++ b/src/lib/xiph/OggSerial.hxx @@ -24,6 +24,6 @@ * Generate the next pseudo-random Ogg serial. */ int -GenerateOggSerial(); +GenerateOggSerial() noexcept; #endif diff --git a/src/lib/xiph/OggStreamState.hxx b/src/lib/xiph/OggStreamState.hxx index 76c1c7958..e572fdd7d 100644 --- a/src/lib/xiph/OggStreamState.hxx +++ b/src/lib/xiph/OggStreamState.hxx @@ -32,7 +32,7 @@ class OggStreamState { ogg_stream_state state; public: - explicit OggStreamState(int serialno) { + explicit OggStreamState(int serialno) noexcept { ogg_stream_init(&state, serialno); } @@ -40,53 +40,53 @@ public: * Initialize a decoding #ogg_stream_state with the first * page. */ - explicit OggStreamState(ogg_page &page) { + explicit OggStreamState(ogg_page &page) noexcept { ogg_stream_init(&state, ogg_page_serialno(&page)); PageIn(page); } - ~OggStreamState() { + ~OggStreamState() noexcept { ogg_stream_clear(&state); } - operator ogg_stream_state &() { + operator ogg_stream_state &() noexcept { return state; } - void Reinitialize(int serialno) { + void Reinitialize(int serialno) noexcept { ogg_stream_reset_serialno(&state, serialno); } - long GetSerialNo() const { + long GetSerialNo() const noexcept { return state.serialno; } - void Reset() { + void Reset() noexcept { ogg_stream_reset(&state); } /* encoding */ - void PacketIn(const ogg_packet &packet) { + void PacketIn(const ogg_packet &packet) noexcept { ogg_stream_packetin(&state, const_cast(&packet)); } - bool PageOut(ogg_page &page) { + bool PageOut(ogg_page &page) noexcept { return ogg_stream_pageout(&state, &page) != 0; } - bool Flush(ogg_page &page) { + bool Flush(ogg_page &page) noexcept { return ogg_stream_flush(&state, &page) != 0; } /* decoding */ - bool PageIn(ogg_page &page) { + bool PageIn(ogg_page &page) noexcept { return ogg_stream_pagein(&state, &page) == 0; } - int PacketOut(ogg_packet &packet) { + int PacketOut(ogg_packet &packet) noexcept { return ogg_stream_packetout(&state, &packet); } }; diff --git a/src/lib/xiph/OggSyncState.hxx b/src/lib/xiph/OggSyncState.hxx index 95cb269cf..3ac9d4461 100644 --- a/src/lib/xiph/OggSyncState.hxx +++ b/src/lib/xiph/OggSyncState.hxx @@ -49,7 +49,7 @@ public: OggSyncState(const OggSyncState &) = delete; OggSyncState &operator=(const OggSyncState &) = delete; - void Reset() { + void Reset() noexcept { ogg_sync_reset(&oy); } diff --git a/src/lib/xiph/VorbisComment.hxx b/src/lib/xiph/VorbisComment.hxx index bafd91614..a51a873cb 100644 --- a/src/lib/xiph/VorbisComment.hxx +++ b/src/lib/xiph/VorbisComment.hxx @@ -31,26 +31,26 @@ class VorbisComment { vorbis_comment vc; public: - VorbisComment() { + VorbisComment() noexcept { vorbis_comment_init(&vc); } - ~VorbisComment() { + ~VorbisComment() noexcept { vorbis_comment_clear(&vc); } VorbisComment(const VorbisComment &) = delete; VorbisComment &operator=(const VorbisComment &) = delete; - operator vorbis_comment &() { + operator vorbis_comment &() noexcept { return vc; } - operator vorbis_comment *() { + operator vorbis_comment *() noexcept { return &vc; } - void AddTag(const char *tag, const char *contents) { + void AddTag(const char *tag, const char *contents) noexcept { vorbis_comment_add_tag(&vc, tag, contents); } }; diff --git a/src/lib/xiph/VorbisComments.cxx b/src/lib/xiph/VorbisComments.cxx index ee865b436..8477a8df4 100644 --- a/src/lib/xiph/VorbisComments.cxx +++ b/src/lib/xiph/VorbisComments.cxx @@ -29,7 +29,7 @@ #include "util/DivideString.hxx" bool -vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments) +vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments) noexcept { rgi.Clear(); @@ -100,7 +100,7 @@ vorbis_comments_scan(char **comments, } Tag * -vorbis_comments_to_tag(char **comments) +vorbis_comments_to_tag(char **comments) noexcept { TagBuilder tag_builder; vorbis_comments_scan(comments, add_tag_handler, &tag_builder); diff --git a/src/lib/xiph/VorbisComments.hxx b/src/lib/xiph/VorbisComments.hxx index 0bc58e892..46ea2beca 100644 --- a/src/lib/xiph/VorbisComments.hxx +++ b/src/lib/xiph/VorbisComments.hxx @@ -27,13 +27,13 @@ struct TagHandler; struct Tag; bool -vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments); +vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments) noexcept; void vorbis_comments_scan(char **comments, const TagHandler &handler, void *handler_ctx); Tag * -vorbis_comments_to_tag(char **comments); +vorbis_comments_to_tag(char **comments) noexcept; #endif