diff --git a/src/command/CommandError.cxx b/src/command/CommandError.cxx index 149f0a0ab..345eb6fec 100644 --- a/src/command/CommandError.cxx +++ b/src/command/CommandError.cxx @@ -27,8 +27,7 @@ #include -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 { diff --git a/src/db/update/InotifyQueue.cxx b/src/db/update/InotifyQueue.cxx index 1e4fa00e5..b731faa61 100644 --- a/src/db/update/InotifyQueue.cxx +++ b/src/db/update/InotifyQueue.cxx @@ -69,7 +69,7 @@ InotifyQueue::OnDelay() noexcept } } -gcc_pure +[[gnu::pure]] static bool path_in(const char *path, const char *possible_parent) noexcept { diff --git a/src/lib/ffmpeg/LogCallback.cxx b/src/lib/ffmpeg/LogCallback.cxx index baf5ec687..d62c0e38c 100644 --- a/src/lib/ffmpeg/LogCallback.cxx +++ b/src/lib/ffmpeg/LogCallback.cxx @@ -30,7 +30,7 @@ extern "C" { #include } -gcc_const +[[gnu::const]] static LogLevel FfmpegImportLogLevel(int level) noexcept { diff --git a/src/lib/upnp/Discovery.cxx b/src/lib/upnp/Discovery.cxx index e7c2c8569..1cc8f813a 100644 --- a/src/lib/upnp/Discovery.cxx +++ b/src/lib/upnp/Discovery.cxx @@ -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 { diff --git a/src/neighbor/plugins/UpnpNeighborPlugin.cxx b/src/neighbor/plugins/UpnpNeighborPlugin.cxx index 821ece602..e0bcbf615 100644 --- a/src/neighbor/plugins/UpnpNeighborPlugin.cxx +++ b/src/neighbor/plugins/UpnpNeighborPlugin.cxx @@ -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 }; }