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

@@ -43,7 +43,7 @@
* enum. Returns SND_PCM_FORMAT_UNKNOWN if there is no according ALSA
* PCM format.
*/
gcc_const
[[gnu::const]]
inline snd_pcm_format_t
ToAlsaPcmFormat(SampleFormat sample_format) noexcept
{
@@ -82,7 +82,7 @@ ToAlsaPcmFormat(SampleFormat sample_format) noexcept
* Determine the byte-swapped PCM format. Returns
* SND_PCM_FORMAT_UNKNOWN if the format cannot be byte-swapped.
*/
gcc_const
[[gnu::const]]
inline snd_pcm_format_t
ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
{
@@ -123,8 +123,7 @@ ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
* Check if there is a "packed" version of the give PCM format.
* Returns SND_PCM_FORMAT_UNKNOWN if not.
*/
gcc_const
inline snd_pcm_format_t
constexpr snd_pcm_format_t
PackAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
{
switch (fmt) {

View File

@@ -23,7 +23,7 @@
#include <stdlib.h>
gcc_pure
[[gnu::pure]]
static uint_least32_t
ParseAlsaVersion(const char *p) noexcept
{

View File

@@ -20,8 +20,6 @@
#ifndef MPD_ALSA_VERSION_HXX
#define MPD_ALSA_VERSION_HXX
#include "util/Compiler.h"
#include <cstdint>
static constexpr uint_least32_t
@@ -35,7 +33,7 @@ MakeAlsaVersion(uint_least32_t major, uint_least32_t minor,
* Wrapper for snd_asoundlib_version() which translates the resulting
* string to an integer constructed with MakeAlsaVersion().
*/
gcc_const
[[gnu::const]]
uint_least32_t
GetRuntimeAlsaVersion() noexcept;