diff options
| author | arades79 <scravers@protonmail.com> | 2023-02-11 13:28:03 -0500 |
|---|---|---|
| committer | arades79 <scravers@protonmail.com> | 2023-02-14 12:33:11 -0500 |
| commit | 45e13b03f372230dbf780f3fa87dd88f388af605 (patch) | |
| tree | 555593e7e5016b6ba2a777d7417ada244abce458 /src/audio_core/renderer/command/data_source | |
| parent | 5f5a6e4b2e541e86c0bfdb99e3acfbbebe89a5d3 (diff) | |
add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/audio_core/renderer/command/data_source')
| -rw-r--r-- | src/audio_core/renderer/command/data_source/decode.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/audio_core/renderer/command/data_source/decode.cpp b/src/audio_core/renderer/command/data_source/decode.cpp index ff5d31bd6..68a0aa15d 100644 --- a/src/audio_core/renderer/command/data_source/decode.cpp +++ b/src/audio_core/renderer/command/data_source/decode.cpp @@ -27,8 +27,8 @@ constexpr std::array<u8, 3> PitchBySrcQuality = {4, 8, 4}; template <typename T> static u32 DecodePcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, const DecodeArg& req) { - constexpr s32 min{std::numeric_limits<s16>::min()}; - constexpr s32 max{std::numeric_limits<s16>::max()}; + constexpr static s32 min{std::numeric_limits<s16>::min()}; + constexpr static s32 max{std::numeric_limits<s16>::max()}; if (req.buffer == 0 || req.buffer_size == 0) { return 0; @@ -101,8 +101,8 @@ static u32 DecodePcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, */ static u32 DecodeAdpcm(Core::Memory::Memory& memory, std::span<s16> out_buffer, const DecodeArg& req) { - constexpr u32 SamplesPerFrame{14}; - constexpr u32 NibblesPerFrame{16}; + constexpr static u32 SamplesPerFrame{14}; + constexpr static u32 NibblesPerFrame{16}; if (req.buffer == 0 || req.buffer_size == 0) { return 0; |
