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 struct SampleTraits; * and caps it if necessary. */ template> -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(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> -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);