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

@@ -326,7 +326,7 @@ public:
*/
std::unique_ptr<DetachedSong> LockReadTaggedSong() noexcept;
gcc_pure
[[gnu::pure]]
PlayerStatus LockGetStatus() noexcept;
PlayerState GetState() const noexcept {
@@ -338,7 +338,7 @@ public:
bool has_next_song;
};
gcc_pure
[[gnu::pure]]
SyncInfo LockGetSyncInfo() const noexcept {
const std::lock_guard<Mutex> protect(mutex);
return {state, next_song != nullptr};

View File

@@ -21,7 +21,6 @@
#define MPD_CROSSFADE_HXX
#include "Chrono.hxx"
#include "util/Compiler.h"
struct AudioFormat;
class SignedSongTime;
@@ -61,7 +60,7 @@ struct CrossFadeSettings {
* @return the number of chunks for crossfading, or 0 if cross fading
* should be disabled for this song change
*/
gcc_pure
[[gnu::pure]]
unsigned Calculate(SignedSongTime total_time,
float replay_gain_db, float replay_gain_prev_db,
const char *mixramp_start,

View File

@@ -22,7 +22,6 @@
#include "MusicChunkPtr.hxx"
#include "Chrono.hxx"
#include "util/Compiler.h"
struct AudioFormat;
struct MusicChunk;
@@ -107,7 +106,7 @@ public:
* chunk. A negative value is returned when no chunk has been
* finished yet.
*/
gcc_pure
[[gnu::pure]]
virtual SignedSongTime GetElapsedTime() const noexcept = 0;
};