add various nodiscard

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2021-11-11 02:27:17 -08:00
parent a8c77a6fba
commit 5deca66fdc
6 changed files with 8 additions and 8 deletions

View File

@ -162,7 +162,7 @@ class Iso9660InputStream final : public InputStream {
std::array<uint8_t, ISO_BLOCKSIZE> data;
public:
ConstBuffer<uint8_t> Read() const noexcept {
[[nodiscard]] ConstBuffer<uint8_t> Read() const noexcept {
assert(fill <= data.size());
assert(position <= fill);

View File

@ -91,7 +91,7 @@ public:
}
#endif
bool IsDefined() const noexcept {
[[nodiscard]] bool IsDefined() const noexcept {
return event.IsDefined();
}

View File

@ -62,7 +62,7 @@ public:
#endif
}
auto &GetEventLoop() const noexcept {
[[nodiscard]] auto &GetEventLoop() const noexcept {
return event.GetEventLoop();
}

View File

@ -61,7 +61,7 @@ public:
CurlSocket(const CurlSocket &) = delete;
CurlSocket &operator=(const CurlSocket &) = delete;
auto &GetEventLoop() const noexcept {
[[nodiscard]] auto &GetEventLoop() const noexcept {
return socket_event.GetEventLoop();
}
@ -73,7 +73,7 @@ public:
void *userp, void *socketp) noexcept;
private:
SocketDescriptor GetSocket() const noexcept {
[[nodiscard]] SocketDescriptor GetSocket() const noexcept {
return socket_event.GetSocket();
}

View File

@ -128,13 +128,13 @@ private:
}
[[gnu::pure]]
double GetNormalizedVolume() const noexcept {
[[nodiscard]] double GetNormalizedVolume() const noexcept {
return get_normalized_playback_volume(elem,
SND_MIXER_SCHN_FRONT_LEFT);
}
[[gnu::pure]]
unsigned GetPercentVolume() const noexcept {
[[nodiscard]] unsigned GetPercentVolume() const noexcept {
return NormalizedToPercent(GetNormalizedVolume());
}

View File

@ -273,7 +273,7 @@ private:
pw_thread_loop_signal(thread_loop, false);
}
std::chrono::steady_clock::duration Delay() const noexcept override;
[[nodiscard]] std::chrono::steady_clock::duration Delay() const noexcept override;
size_t Play(const void *chunk, size_t size) override;
void Drain() override;