use [[gnu::...]] attributes

This commit is contained in:
Max Kellermann
2023-03-06 15:57:36 +01:00
parent 3b9aab0684
commit 42f6a0441c
101 changed files with 167 additions and 234 deletions

View File

@@ -4,8 +4,6 @@
#ifndef MPD_ID_TABLE_HXX
#define MPD_ID_TABLE_HXX
#include "util/Compiler.h"
#include <cassert>
/**

View File

@@ -96,17 +96,17 @@ struct playlist {
return queue.PositionToId(position);
}
gcc_pure
[[gnu::pure]]
int GetCurrentPosition() const noexcept;
gcc_pure
[[gnu::pure]]
int GetNextPosition() const noexcept;
/**
* Returns the song object which is currently queued. Returns
* none if there is none (yet?) or if MPD isn't playing.
*/
gcc_pure
[[gnu::pure]]
const DetachedSong *GetQueuedSong() const noexcept;
/**

View File

@@ -4,7 +4,6 @@
#ifndef MPD_QUEUE_HXX
#define MPD_QUEUE_HXX
#include "util/Compiler.h"
#include "IdTable.hxx"
#include "SingleMode.hxx"
#include "ConsumeMode.hxx"
@@ -141,14 +140,14 @@ struct Queue {
return items[position].id;
}
gcc_pure
[[gnu::pure]]
unsigned OrderToPosition(unsigned _order) const noexcept {
assert(_order < length);
return order[_order];
}
gcc_pure
[[gnu::pure]]
unsigned PositionToOrder(unsigned position) const noexcept {
assert(position < length);
@@ -160,7 +159,7 @@ struct Queue {
}
}
gcc_pure
[[gnu::pure]]
uint8_t GetPriorityAtPosition(unsigned position) const noexcept {
assert(position < length);
@@ -217,7 +216,7 @@ struct Queue {
*
* @return the next order number, or -1 to stop playback
*/
gcc_pure
[[gnu::pure]]
int GetNextOrder(unsigned order) const noexcept;
/**
@@ -375,11 +374,11 @@ private:
* Find the first item that has this specified priority or
* higher.
*/
gcc_pure
[[gnu::pure]]
unsigned FindPriorityOrder(unsigned start_order, uint8_t priority,
unsigned exclude_order) const noexcept;
gcc_pure
[[gnu::pure]]
unsigned CountSamePriority(unsigned start_order,
uint8_t priority) const noexcept;
};