diff options
-rw-r--r-- | src/pcm/Clamp.hxx | 3 | ||||
-rw-r--r-- | src/pcm/FloatConvert.hxx | 3 | ||||
-rw-r--r-- | src/pcm/PcmMix.cxx | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/src/pcm/Clamp.hxx b/src/pcm/Clamp.hxx index 2461ba2a9..6d94f3b7c 100644 --- a/src/pcm/Clamp.hxx +++ b/src/pcm/Clamp.hxx @@ -34,8 +34,7 @@ template<SampleFormat F> struct SampleTraits; * and caps it if necessary. */ template<SampleFormat F, class Traits=SampleTraits<F>> -gcc_const -static inline typename Traits::value_type +constexpr typename Traits::value_type PcmClamp(typename Traits::long_type x) noexcept { typedef typename Traits::value_type T; diff --git a/src/pcm/FloatConvert.hxx b/src/pcm/FloatConvert.hxx index 8f77227ec..1fa275427 100644 --- a/src/pcm/FloatConvert.hxx +++ b/src/pcm/FloatConvert.hxx @@ -37,8 +37,7 @@ struct FloatToIntegerSampleConvert { static constexpr SV factor = uintmax_t(1) << (DstTraits::BITS - 1); static_assert(factor > 0, "Wrong factor"); - gcc_const - static DV Convert(SV src) noexcept { + static constexpr DV Convert(SV src) noexcept { return PcmClamp<F, Traits>(SL(src * factor)); } }; diff --git a/src/pcm/PcmMix.cxx b/src/pcm/PcmMix.cxx index 09b374b9b..bbbf0c3ec 100644 --- a/src/pcm/PcmMix.cxx +++ b/src/pcm/PcmMix.cxx @@ -134,7 +134,7 @@ pcm_add_vol(PcmDither &dither, void *buffer1, const void *buffer2, size_t size, } template<SampleFormat F, class Traits=SampleTraits<F>> -static typename Traits::value_type +static constexpr typename Traits::value_type PcmAdd(typename Traits::value_type _a, typename Traits::value_type _b) noexcept { typename Traits::sum_type a(_a), b(_b); |