From 683019878fc939b418a65e1c5d84b066596d7655 Mon Sep 17 00:00:00 2001 From: arades79 Date: Tue, 14 Feb 2023 11:13:47 -0500 Subject: remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistency Signed-off-by: arades79 --- src/audio_core/renderer/adsp/audio_renderer.cpp | 4 ++-- src/audio_core/renderer/command/data_source/decode.cpp | 8 ++++---- src/audio_core/renderer/command/effect/biquad_filter.cpp | 8 ++++---- src/audio_core/renderer/command/effect/i3dl2_reverb.cpp | 8 ++++---- src/audio_core/renderer/command/effect/light_limiter.cpp | 4 ++-- src/audio_core/renderer/command/effect/reverb.cpp | 8 ++++---- src/audio_core/renderer/command/resample/upsample.cpp | 12 ++++++------ src/audio_core/renderer/command/sink/circular_buffer.cpp | 4 ++-- src/audio_core/renderer/command/sink/device.cpp | 4 ++-- src/audio_core/renderer/system_manager.cpp | 2 +- src/audio_core/renderer/voice/voice_info.cpp | 4 ++-- src/audio_core/sink/sink_stream.cpp | 12 ++++++------ 12 files changed, 39 insertions(+), 39 deletions(-) (limited to 'src/audio_core') diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp index 5bafd4c06..78c15629b 100644 --- a/src/audio_core/renderer/adsp/audio_renderer.cpp +++ b/src/audio_core/renderer/adsp/audio_renderer.cpp @@ -132,7 +132,7 @@ void AudioRenderer::CreateSinkStreams() { } void AudioRenderer::ThreadFunc() { - constexpr static char name[]{"AudioRenderer"}; + static constexpr char name[]{"AudioRenderer"}; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); @@ -144,7 +144,7 @@ void AudioRenderer::ThreadFunc() { mailbox->ADSPSendMessage(RenderMessage::AudioRenderer_InitializeOK); - constexpr static u64 max_process_time{2'304'000ULL}; + constexpr u64 max_process_time{2'304'000ULL}; while (true) { auto message{mailbox->ADSPWaitMessage()}; diff --git a/src/audio_core/renderer/command/data_source/decode.cpp b/src/audio_core/renderer/command/data_source/decode.cpp index 68a0aa15d..ff5d31bd6 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 PitchBySrcQuality = {4, 8, 4}; template static u32 DecodePcm(Core::Memory::Memory& memory, std::span out_buffer, const DecodeArg& req) { - constexpr static s32 min{std::numeric_limits::min()}; - constexpr static s32 max{std::numeric_limits::max()}; + constexpr s32 min{std::numeric_limits::min()}; + constexpr s32 max{std::numeric_limits::max()}; if (req.buffer == 0 || req.buffer_size == 0) { return 0; @@ -101,8 +101,8 @@ static u32 DecodePcm(Core::Memory::Memory& memory, std::span out_buffer, */ static u32 DecodeAdpcm(Core::Memory::Memory& memory, std::span out_buffer, const DecodeArg& req) { - constexpr static u32 SamplesPerFrame{14}; - constexpr static u32 NibblesPerFrame{16}; + constexpr u32 SamplesPerFrame{14}; + constexpr u32 NibblesPerFrame{16}; if (req.buffer == 0 || req.buffer_size == 0) { return 0; diff --git a/src/audio_core/renderer/command/effect/biquad_filter.cpp b/src/audio_core/renderer/command/effect/biquad_filter.cpp index 84fb6ae7a..dea6423dc 100644 --- a/src/audio_core/renderer/command/effect/biquad_filter.cpp +++ b/src/audio_core/renderer/command/effect/biquad_filter.cpp @@ -20,8 +20,8 @@ namespace AudioCore::AudioRenderer { void ApplyBiquadFilterFloat(std::span output, std::span input, std::array& b_, std::array& a_, VoiceState::BiquadFilterState& state, const u32 sample_count) { - constexpr static f64 min{std::numeric_limits::min()}; - constexpr static f64 max{std::numeric_limits::max()}; + constexpr f64 min{std::numeric_limits::min()}; + constexpr f64 max{std::numeric_limits::max()}; std::array b{Common::FixedPoint<50, 14>::from_base(b_[0]).to_double(), Common::FixedPoint<50, 14>::from_base(b_[1]).to_double(), Common::FixedPoint<50, 14>::from_base(b_[2]).to_double()}; @@ -61,8 +61,8 @@ void ApplyBiquadFilterFloat(std::span output, std::span input, static void ApplyBiquadFilterInt(std::span output, std::span input, std::array& b, std::array& a, VoiceState::BiquadFilterState& state, const u32 sample_count) { - constexpr static s64 min{std::numeric_limits::min()}; - constexpr static s64 max{std::numeric_limits::max()}; + constexpr s64 min{std::numeric_limits::min()}; + constexpr s64 max{std::numeric_limits::max()}; for (u32 i = 0; i < sample_count; i++) { const s64 in_sample{input[i]}; diff --git a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp index 98217cd2d..27d8b9844 100644 --- a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp +++ b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp @@ -244,16 +244,16 @@ template static void ApplyI3dl2ReverbEffect(I3dl2ReverbInfo::State& state, std::span> inputs, std::span> outputs, const u32 sample_count) { - constexpr static std::array OutTapIndexes1Ch{ + static constexpr std::array OutTapIndexes1Ch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - constexpr static std::array OutTapIndexes2Ch{ + static constexpr std::array OutTapIndexes2Ch{ 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, }; - constexpr static std::array OutTapIndexes4Ch{ + static constexpr std::array OutTapIndexes4Ch{ 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, }; - constexpr static std::array OutTapIndexes6Ch{ + static constexpr std::array OutTapIndexes6Ch{ 2, 0, 0, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, }; diff --git a/src/audio_core/renderer/command/effect/light_limiter.cpp b/src/audio_core/renderer/command/effect/light_limiter.cpp index 410e5dac0..e8fb0e2fc 100644 --- a/src/audio_core/renderer/command/effect/light_limiter.cpp +++ b/src/audio_core/renderer/command/effect/light_limiter.cpp @@ -50,8 +50,8 @@ static void ApplyLightLimiterEffect(const LightLimiterInfo::ParameterVersion2& p std::vector>& inputs, std::vector>& outputs, const u32 sample_count, LightLimiterInfo::StatisticsInternal* statistics) { - constexpr static s64 min{std::numeric_limits::min()}; - constexpr static s64 max{std::numeric_limits::max()}; + constexpr s64 min{std::numeric_limits::min()}; + constexpr s64 max{std::numeric_limits::max()}; const auto recip_estimate = [](f64 a) -> f64 { s32 q, s; diff --git a/src/audio_core/renderer/command/effect/reverb.cpp b/src/audio_core/renderer/command/effect/reverb.cpp index ffe108268..6fe844ff0 100644 --- a/src/audio_core/renderer/command/effect/reverb.cpp +++ b/src/audio_core/renderer/command/effect/reverb.cpp @@ -252,16 +252,16 @@ template static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, ReverbInfo::State& state, std::vector>& inputs, std::vector>& outputs, const u32 sample_count) { - constexpr static std::array OutTapIndexes1Ch{ + static constexpr std::array OutTapIndexes1Ch{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - constexpr static std::array OutTapIndexes2Ch{ + static constexpr std::array OutTapIndexes2Ch{ 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, }; - constexpr static std::array OutTapIndexes4Ch{ + static constexpr std::array OutTapIndexes4Ch{ 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, }; - constexpr static std::array OutTapIndexes6Ch{ + static constexpr std::array OutTapIndexes6Ch{ 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, }; diff --git a/src/audio_core/renderer/command/resample/upsample.cpp b/src/audio_core/renderer/command/resample/upsample.cpp index 4bd604754..86ddee1a4 100644 --- a/src/audio_core/renderer/command/resample/upsample.cpp +++ b/src/audio_core/renderer/command/resample/upsample.cpp @@ -19,24 +19,24 @@ namespace AudioCore::AudioRenderer { static void SrcProcessFrame(std::span output, std::span input, const u32 target_sample_count, const u32 source_sample_count, UpsamplerState* state) { - constexpr static u32 WindowSize = 10; - constexpr static std::array, WindowSize> WindowedSinc1{ + static constexpr u32 WindowSize = 10; + static constexpr std::array, WindowSize> WindowedSinc1{ 0.95376587f, -0.12872314f, 0.060028076f, -0.032470703f, 0.017669678f, -0.009124756f, 0.004272461f, -0.001739502f, 0.000579834f, -0.000091552734f, }; - constexpr static std::array, WindowSize> WindowedSinc2{ + static constexpr std::array, WindowSize> WindowedSinc2{ 0.8230896f, -0.19161987f, 0.093444824f, -0.05090332f, 0.027557373f, -0.014038086f, 0.0064697266f, -0.002532959f, 0.00079345703f, -0.00012207031f, }; - constexpr static std::array, WindowSize> WindowedSinc3{ + static constexpr std::array, WindowSize> WindowedSinc3{ 0.6298828f, -0.19274902f, 0.09725952f, -0.05319214f, 0.028625488f, -0.014373779f, 0.006500244f, -0.0024719238f, 0.0007324219f, -0.000091552734f, }; - constexpr static std::array, WindowSize> WindowedSinc4{ + static constexpr std::array, WindowSize> WindowedSinc4{ 0.4057312f, -0.1468811f, 0.07601929f, -0.041656494f, 0.022216797f, -0.011016846f, 0.004852295f, -0.0017700195f, 0.00048828125f, -0.000030517578f, }; - constexpr static std::array, WindowSize> WindowedSinc5{ + static constexpr std::array, WindowSize> WindowedSinc5{ 0.1854248f, -0.075164795f, 0.03967285f, -0.021728516f, 0.011474609f, -0.005584717f, 0.0024108887f, -0.0008239746f, 0.00021362305f, 0.0f, }; diff --git a/src/audio_core/renderer/command/sink/circular_buffer.cpp b/src/audio_core/renderer/command/sink/circular_buffer.cpp index 1989873db..ded5afc94 100644 --- a/src/audio_core/renderer/command/sink/circular_buffer.cpp +++ b/src/audio_core/renderer/command/sink/circular_buffer.cpp @@ -21,8 +21,8 @@ void CircularBufferSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListPro } void CircularBufferSinkCommand::Process(const ADSP::CommandListProcessor& processor) { - constexpr static s32 min{std::numeric_limits::min()}; - constexpr static s32 max{std::numeric_limits::max()}; + constexpr s32 min{std::numeric_limits::min()}; + constexpr s32 max{std::numeric_limits::max()}; std::vector output(processor.sample_count); for (u32 channel = 0; channel < input_count; channel++) { diff --git a/src/audio_core/renderer/command/sink/device.cpp b/src/audio_core/renderer/command/sink/device.cpp index 2f2e82ae2..e88372a75 100644 --- a/src/audio_core/renderer/command/sink/device.cpp +++ b/src/audio_core/renderer/command/sink/device.cpp @@ -20,8 +20,8 @@ void DeviceSinkCommand::Dump([[maybe_unused]] const ADSP::CommandListProcessor& } void DeviceSinkCommand::Process(const ADSP::CommandListProcessor& processor) { - constexpr static s32 min = std::numeric_limits::min(); - constexpr static s32 max = std::numeric_limits::max(); + constexpr s32 min = std::numeric_limits::min(); + constexpr s32 max = std::numeric_limits::max(); auto stream{processor.GetOutputSinkStream()}; stream->SetSystemChannels(input_count); diff --git a/src/audio_core/renderer/system_manager.cpp b/src/audio_core/renderer/system_manager.cpp index a8517014e..ce631f810 100644 --- a/src/audio_core/renderer/system_manager.cpp +++ b/src/audio_core/renderer/system_manager.cpp @@ -94,7 +94,7 @@ bool SystemManager::Remove(System& system_) { } void SystemManager::ThreadFunc() { - constexpr static char name[]{"AudioRenderSystemManager"}; + static constexpr char name[]{"AudioRenderSystemManager"}; MicroProfileOnThreadCreate(name); Common::SetCurrentThreadName(name); Common::SetCurrentThreadPriority(Common::ThreadPriority::High); diff --git a/src/audio_core/renderer/voice/voice_info.cpp b/src/audio_core/renderer/voice/voice_info.cpp index 2b3705647..1849eeb57 100644 --- a/src/audio_core/renderer/voice/voice_info.cpp +++ b/src/audio_core/renderer/voice/voice_info.cpp @@ -177,7 +177,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span error_info, switch (sample_format_) { case SampleFormat::PcmInt16: { - constexpr static auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmInt16)}; + constexpr auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmInt16)}; if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { LOG_ERROR(Service_Audio, "Invalid PCM16 start/end wavebuffer sizes!"); @@ -188,7 +188,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span error_info, } break; case SampleFormat::PcmFloat: { - constexpr static auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmFloat)}; + constexpr auto byte_size{GetSampleFormatByteSize(SampleFormat::PcmFloat)}; if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { LOG_ERROR(Service_Audio, "Invalid PCMFloat start/end wavebuffer sizes!"); diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index fa3cee3ea..2fb5f9758 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp @@ -24,8 +24,8 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::vector& samples) { return; } - constexpr static s32 min{std::numeric_limits::min()}; - constexpr static s32 max{std::numeric_limits::max()}; + constexpr s32 min{std::numeric_limits::min()}; + constexpr s32 max{std::numeric_limits::max()}; auto yuzu_volume{Settings::Volume()}; if (yuzu_volume > 1.0f) { @@ -35,7 +35,7 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::vector& samples) { if (system_channels == 6 && device_channels == 2) { // We're given 6 channels, but our device only outputs 2, so downmix. - constexpr static std::array down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; + static constexpr std::array down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; for (u32 read_index = 0, write_index = 0; read_index < samples.size(); read_index += system_channels, write_index += device_channels) { @@ -106,8 +106,8 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::vector& samples) { } std::vector SinkStream::ReleaseBuffer(u64 num_samples) { - constexpr static s32 min = std::numeric_limits::min(); - constexpr static s32 max = std::numeric_limits::max(); + constexpr s32 min = std::numeric_limits::min(); + constexpr s32 max = std::numeric_limits::max(); auto samples{samples_buffer.Pop(num_samples)}; @@ -202,7 +202,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span output_buffer, std::siz // If we're paused or going to shut down, we don't want to consume buffers as coretiming is // paused and we'll desync, so just play silence. if (system.IsPaused() || system.IsShuttingDown()) { - constexpr static std::array silence{}; + static constexpr std::array silence{}; for (size_t i = frames_written; i < num_frames; i++) { std::memcpy(&output_buffer[i * frame_size], &silence[0], frame_size_bytes); } -- cgit v1.2.3