Commit 2fbbd540 authored by Max Kellermann's avatar Max Kellermann

more [[gnu::...]] attributes

parent 18f64b5f
......@@ -27,8 +27,7 @@
#include <system_error>
gcc_const
static enum ack
static constexpr enum ack
ToAck(PlaylistResult result) noexcept
{
switch (result) {
......@@ -63,8 +62,8 @@ ToAck(PlaylistResult result) noexcept
}
#ifdef ENABLE_DATABASE
gcc_const
static enum ack
static constexpr enum ack
ToAck(DatabaseErrorCode code) noexcept
{
switch (code) {
......@@ -78,9 +77,10 @@ ToAck(DatabaseErrorCode code) noexcept
return ACK_ERROR_UNKNOWN;
}
#endif
gcc_pure
[[gnu::pure]]
static enum ack
ToAck(const std::exception_ptr& ep) noexcept
{
......
......@@ -69,7 +69,7 @@ InotifyQueue::OnDelay() noexcept
}
}
gcc_pure
[[gnu::pure]]
static bool
path_in(const char *path, const char *possible_parent) noexcept
{
......
......@@ -30,7 +30,7 @@ extern "C" {
#include <libavutil/log.h>
}
gcc_const
[[gnu::const]]
static LogLevel
FfmpegImportLogLevel(int level) noexcept
{
......
......@@ -99,7 +99,7 @@ static constexpr char ContentDirectorySType[] = "urn:schemas-upnp-org:service:Co
// We don't include a version in comparisons, as we are satisfied with
// version 1
gcc_pure
[[gnu::pure]]
static bool
isCDService(const char *st) noexcept
{
......@@ -110,7 +110,7 @@ isCDService(const char *st) noexcept
// The type of device we're asking for in search
static constexpr char MediaServerDType[] = "urn:schemas-upnp-org:device:MediaServer:1";
gcc_pure
[[gnu::pure]]
static bool
isMSDevice(const char *st) noexcept
{
......
......@@ -40,12 +40,12 @@ class UpnpNeighborExplorer final
Server(const Server &) = delete;
Server &operator=(const Server &) = delete;
gcc_pure
[[gnu::pure]]
bool operator==(const Server &other) const noexcept {
return name == other.name;
}
[[nodiscard]] gcc_pure
[[nodiscard]] [[gnu::pure]]
NeighborInfo Export() const noexcept {
return { "smb://" + name + "/", comment };
}
......
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