Commit 5deca66f authored by Rosen Penev's avatar Rosen Penev

add various nodiscard

Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
parent a8c77a6f
...@@ -162,7 +162,7 @@ class Iso9660InputStream final : public InputStream { ...@@ -162,7 +162,7 @@ class Iso9660InputStream final : public InputStream {
std::array<uint8_t, ISO_BLOCKSIZE> data; std::array<uint8_t, ISO_BLOCKSIZE> data;
public: public:
ConstBuffer<uint8_t> Read() const noexcept { [[nodiscard]] ConstBuffer<uint8_t> Read() const noexcept {
assert(fill <= data.size()); assert(fill <= data.size());
assert(position <= fill); assert(position <= fill);
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
} }
#endif #endif
bool IsDefined() const noexcept { [[nodiscard]] bool IsDefined() const noexcept {
return event.IsDefined(); return event.IsDefined();
} }
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
#endif #endif
} }
auto &GetEventLoop() const noexcept { [[nodiscard]] auto &GetEventLoop() const noexcept {
return event.GetEventLoop(); return event.GetEventLoop();
} }
......
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
CurlSocket(const CurlSocket &) = delete; CurlSocket(const CurlSocket &) = delete;
CurlSocket &operator=(const CurlSocket &) = delete; CurlSocket &operator=(const CurlSocket &) = delete;
auto &GetEventLoop() const noexcept { [[nodiscard]] auto &GetEventLoop() const noexcept {
return socket_event.GetEventLoop(); return socket_event.GetEventLoop();
} }
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
void *userp, void *socketp) noexcept; void *userp, void *socketp) noexcept;
private: private:
SocketDescriptor GetSocket() const noexcept { [[nodiscard]] SocketDescriptor GetSocket() const noexcept {
return socket_event.GetSocket(); return socket_event.GetSocket();
} }
......
...@@ -128,13 +128,13 @@ private: ...@@ -128,13 +128,13 @@ private:
} }
[[gnu::pure]] [[gnu::pure]]
double GetNormalizedVolume() const noexcept { [[nodiscard]] double GetNormalizedVolume() const noexcept {
return get_normalized_playback_volume(elem, return get_normalized_playback_volume(elem,
SND_MIXER_SCHN_FRONT_LEFT); SND_MIXER_SCHN_FRONT_LEFT);
} }
[[gnu::pure]] [[gnu::pure]]
unsigned GetPercentVolume() const noexcept { [[nodiscard]] unsigned GetPercentVolume() const noexcept {
return NormalizedToPercent(GetNormalizedVolume()); return NormalizedToPercent(GetNormalizedVolume());
} }
......
...@@ -273,7 +273,7 @@ private: ...@@ -273,7 +273,7 @@ private:
pw_thread_loop_signal(thread_loop, false); 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; size_t Play(const void *chunk, size_t size) override;
void Drain() override; void Drain() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment