pcm/AudioFormat: use [[gnu::pure]]
This commit is contained in:
parent
1cb7fe12ff
commit
7d7fe756b3
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "pcm/SampleFormat.hxx" // IWYU pragma: export
|
#include "pcm/SampleFormat.hxx" // IWYU pragma: export
|
||||||
#include "pcm/ChannelDefs.hxx" // IWYU pragma: export
|
#include "pcm/ChannelDefs.hxx" // IWYU pragma: export
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -124,14 +123,14 @@ struct AudioFormat {
|
|||||||
|
|
||||||
void ApplyMask(AudioFormat mask) noexcept;
|
void ApplyMask(AudioFormat mask) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
AudioFormat WithMask(AudioFormat mask) const noexcept {
|
AudioFormat WithMask(AudioFormat mask) const noexcept {
|
||||||
AudioFormat result = *this;
|
AudioFormat result = *this;
|
||||||
result.ApplyMask(mask);
|
result.ApplyMask(mask);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool MatchMask(AudioFormat mask) const noexcept {
|
bool MatchMask(AudioFormat mask) const noexcept {
|
||||||
return WithMask(mask) == *this;
|
return WithMask(mask) == *this;
|
||||||
}
|
}
|
||||||
@ -226,7 +225,7 @@ AudioFormat::GetFrameSize() const noexcept
|
|||||||
* @param af the #AudioFormat object
|
* @param af the #AudioFormat object
|
||||||
* @return the string buffer
|
* @return the string buffer
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
StringBuffer<24>
|
StringBuffer<24>
|
||||||
ToString(AudioFormat af) noexcept;
|
ToString(AudioFormat af) noexcept;
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ sample_format_size(SampleFormat format) noexcept
|
|||||||
* @param format a #SampleFormat enum value
|
* @param format a #SampleFormat enum value
|
||||||
* @return the string
|
* @return the string
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_returns_nonnull
|
[[gnu::pure]] [[gnu::returns_nonnull]]
|
||||||
const char *
|
const char *
|
||||||
sample_format_to_string(SampleFormat format) noexcept;
|
sample_format_to_string(SampleFormat format) noexcept;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user