diff --git a/src/AudioFormat.hxx b/src/AudioFormat.hxx index 38d0aa9a6..469af2813 100644 --- a/src/AudioFormat.hxx +++ b/src/AudioFormat.hxx @@ -178,8 +178,8 @@ struct AudioFormat { * * @param sample_rate the sample rate in Hz */ -static constexpr inline bool -audio_valid_sample_rate(unsigned sample_rate) +constexpr bool +audio_valid_sample_rate(unsigned sample_rate) noexcept { return sample_rate > 0 && sample_rate < (1 << 30); } @@ -187,8 +187,8 @@ audio_valid_sample_rate(unsigned sample_rate) /** * Checks whether the number of channels is valid. */ -static constexpr inline bool -audio_valid_channel_count(unsigned channels) +constexpr bool +audio_valid_channel_count(unsigned channels) noexcept { return channels >= 1 && channels <= MAX_CHANNELS; } diff --git a/src/pcm/Dsd16.cxx b/src/pcm/Dsd16.cxx index c93845893..5bed7948f 100644 --- a/src/pcm/Dsd16.cxx +++ b/src/pcm/Dsd16.cxx @@ -24,7 +24,7 @@ /** * Construct a 16 bit integer from two bytes. */ -static constexpr inline uint16_t +static constexpr uint16_t Construct16(uint8_t a, uint8_t b) noexcept { /* "a" is the oldest byte, which must be in the most @@ -33,7 +33,7 @@ Construct16(uint8_t a, uint8_t b) noexcept return uint16_t(b) | (uint16_t(a) << 8); } -static constexpr inline uint16_t +static constexpr uint16_t Dsd8To16Sample(const uint8_t *src, unsigned channels) noexcept { return Construct16(src[0], src[channels]); diff --git a/src/pcm/Dsd32.cxx b/src/pcm/Dsd32.cxx index 085654ade..749a0b44b 100644 --- a/src/pcm/Dsd32.cxx +++ b/src/pcm/Dsd32.cxx @@ -24,7 +24,7 @@ /** * Construct a 32 bit integer from four bytes. */ -static constexpr inline uint32_t +static constexpr uint32_t Construct32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) noexcept { /* "a" is the oldest byte, which must be in the most @@ -34,7 +34,7 @@ Construct32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) noexcept (uint32_t(b) << 16) | (uint32_t(a) << 24); } -static constexpr inline uint32_t +static constexpr uint32_t Dsd8To32Sample(const uint8_t *src, unsigned channels) noexcept { return Construct32(src[0], src[channels], diff --git a/src/pcm/Volume.hxx b/src/pcm/Volume.hxx index ddc6cb854..a5d53de7a 100644 --- a/src/pcm/Volume.hxx +++ b/src/pcm/Volume.hxx @@ -45,13 +45,13 @@ static constexpr int PCM_VOLUME_1S = PCM_VOLUME_1; * Converts a float value (0.0 = silence, 1.0 = 100% volume) to an * integer volume value (1000 = 100%). */ -static constexpr inline int +constexpr int pcm_float_to_volume(float volume) noexcept { return volume * PCM_VOLUME_1 + 0.5; } -static constexpr inline float +constexpr float pcm_volume_to_float(int volume) noexcept { return (float)volume / (float)PCM_VOLUME_1;