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

This commit is contained in:
Max Kellermann
2021-10-13 11:28:04 +02:00
parent 1c4b484a56
commit f510564d9d
135 changed files with 361 additions and 514 deletions

View File

@@ -27,7 +27,6 @@
#include "tag/Mask.hxx"
#include "event/FullyBufferedSocket.hxx"
#include "event/CoarseTimerEvent.hxx"
#include "util/Compiler.h"
#include <boost/intrusive/link_mode.hpp>
#include <boost/intrusive/list_hook.hpp>
@@ -138,7 +137,7 @@ public:
using FullyBufferedSocket::GetEventLoop;
using FullyBufferedSocket::GetOutputMaxSize;
gcc_pure
[[gnu::pure]]
bool IsExpired() const noexcept {
return !FullyBufferedSocket::IsDefined();
}
@@ -211,7 +210,7 @@ public:
FULL,
};
gcc_pure
[[gnu::pure]]
bool IsSubscribed(const char *channel_name) const noexcept {
return subscriptions.find(channel_name) != subscriptions.end();
}
@@ -252,19 +251,19 @@ public:
void SetPartition(Partition &new_partition) noexcept;
gcc_pure
[[gnu::pure]]
Instance &GetInstance() const noexcept;
gcc_pure
[[gnu::pure]]
playlist &GetPlaylist() const noexcept;
gcc_pure
[[gnu::pure]]
PlayerControl &GetPlayerControl() const noexcept;
/**
* Wrapper for Instance::GetDatabase().
*/
gcc_pure
[[gnu::pure]]
const Database *GetDatabase() const noexcept;
/**
@@ -272,7 +271,7 @@ public:
*/
const Database &GetDatabaseOrThrow() const;
gcc_pure
[[gnu::pure]]
const Storage *GetStorage() const noexcept;
private:

View File

@@ -20,8 +20,6 @@
#ifndef MPD_CLIENT_MESSAGE_HXX
#define MPD_CLIENT_MESSAGE_HXX
#include "util/Compiler.h"
#include <string>
#ifdef _WIN32
@@ -51,7 +49,7 @@ public:
}
};
gcc_pure
[[gnu::pure]]
bool
client_message_valid_channel_name(const char *name) noexcept;