diff options
| author | 2023-02-15 17:42:38 -0500 | |
|---|---|---|
| committer | 2023-02-15 17:42:38 -0500 | |
| commit | 04d2d2ef5fdd56baa0ecf60e59ea4e915262161d (patch) | |
| tree | 3951ff8988fff573acd7f2b4edf5d95774b3721d | |
| parent | Merge pull request #9809 from liamwhite/unused-service (diff) | |
| parent | remove constexpr from virtual function (diff) | |
| download | yuzu-04d2d2ef5fdd56baa0ecf60e59ea4e915262161d.tar.gz yuzu-04d2d2ef5fdd56baa0ecf60e59ea4e915262161d.tar.xz yuzu-04d2d2ef5fdd56baa0ecf60e59ea4e915262161d.zip | |
Merge pull request #9782 from arades79/fix-consexpr-value-declaration-usage
Fix consexpr value declaration usage
Diffstat (limited to '')
26 files changed, 54 insertions, 60 deletions
diff --git a/src/audio_core/renderer/adsp/audio_renderer.cpp b/src/audio_core/renderer/adsp/audio_renderer.cpp index d982ef630..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() { | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | void AudioRenderer::ThreadFunc() { | 134 | void AudioRenderer::ThreadFunc() { |
| 135 | constexpr char name[]{"AudioRenderer"}; | 135 | static constexpr char name[]{"AudioRenderer"}; |
| 136 | MicroProfileOnThreadCreate(name); | 136 | MicroProfileOnThreadCreate(name); |
| 137 | Common::SetCurrentThreadName(name); | 137 | Common::SetCurrentThreadName(name); |
| 138 | Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); | 138 | Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); |
diff --git a/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp b/src/audio_core/renderer/command/effect/i3dl2_reverb.cpp index 2187d8a65..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 <size_t NumChannels> | |||
| 244 | static void ApplyI3dl2ReverbEffect(I3dl2ReverbInfo::State& state, | 244 | static void ApplyI3dl2ReverbEffect(I3dl2ReverbInfo::State& state, |
| 245 | std::span<std::span<const s32>> inputs, | 245 | std::span<std::span<const s32>> inputs, |
| 246 | std::span<std::span<s32>> outputs, const u32 sample_count) { | 246 | std::span<std::span<s32>> outputs, const u32 sample_count) { |
| 247 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ | 247 | static constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ |
| 248 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 248 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 249 | }; | 249 | }; |
| 250 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ | 250 | static constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ |
| 251 | 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, | 251 | 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, |
| 252 | }; | 252 | }; |
| 253 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ | 253 | static constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ |
| 254 | 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, | 254 | 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, |
| 255 | }; | 255 | }; |
| 256 | constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ | 256 | static constexpr std::array<u8, I3dl2ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ |
| 257 | 2, 0, 0, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, | 257 | 2, 0, 0, 1, 1, 1, 1, 4, 4, 4, 1, 1, 1, 0, 0, 0, 0, 5, 5, 5, |
| 258 | }; | 258 | }; |
| 259 | 259 | ||
diff --git a/src/audio_core/renderer/command/effect/reverb.cpp b/src/audio_core/renderer/command/effect/reverb.cpp index 427489214..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 <size_t NumChannels> | |||
| 252 | static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, ReverbInfo::State& state, | 252 | static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, ReverbInfo::State& state, |
| 253 | std::vector<std::span<const s32>>& inputs, | 253 | std::vector<std::span<const s32>>& inputs, |
| 254 | std::vector<std::span<s32>>& outputs, const u32 sample_count) { | 254 | std::vector<std::span<s32>>& outputs, const u32 sample_count) { |
| 255 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ | 255 | static constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes1Ch{ |
| 256 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 256 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 257 | }; | 257 | }; |
| 258 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ | 258 | static constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes2Ch{ |
| 259 | 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, | 259 | 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, |
| 260 | }; | 260 | }; |
| 261 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ | 261 | static constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes4Ch{ |
| 262 | 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, | 262 | 0, 0, 1, 1, 0, 1, 2, 2, 3, 3, |
| 263 | }; | 263 | }; |
| 264 | constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ | 264 | static constexpr std::array<u8, ReverbInfo::MaxDelayTaps> OutTapIndexes6Ch{ |
| 265 | 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, | 265 | 0, 0, 1, 1, 2, 2, 4, 4, 5, 5, |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
diff --git a/src/audio_core/renderer/command/resample/upsample.cpp b/src/audio_core/renderer/command/resample/upsample.cpp index 5f7db12ca..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 { | |||
| 19 | static void SrcProcessFrame(std::span<s32> output, std::span<const s32> input, | 19 | static void SrcProcessFrame(std::span<s32> output, std::span<const s32> input, |
| 20 | const u32 target_sample_count, const u32 source_sample_count, | 20 | const u32 target_sample_count, const u32 source_sample_count, |
| 21 | UpsamplerState* state) { | 21 | UpsamplerState* state) { |
| 22 | constexpr u32 WindowSize = 10; | 22 | static constexpr u32 WindowSize = 10; |
| 23 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc1{ | 23 | static constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc1{ |
| 24 | 0.95376587f, -0.12872314f, 0.060028076f, -0.032470703f, 0.017669678f, | 24 | 0.95376587f, -0.12872314f, 0.060028076f, -0.032470703f, 0.017669678f, |
| 25 | -0.009124756f, 0.004272461f, -0.001739502f, 0.000579834f, -0.000091552734f, | 25 | -0.009124756f, 0.004272461f, -0.001739502f, 0.000579834f, -0.000091552734f, |
| 26 | }; | 26 | }; |
| 27 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc2{ | 27 | static constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc2{ |
| 28 | 0.8230896f, -0.19161987f, 0.093444824f, -0.05090332f, 0.027557373f, | 28 | 0.8230896f, -0.19161987f, 0.093444824f, -0.05090332f, 0.027557373f, |
| 29 | -0.014038086f, 0.0064697266f, -0.002532959f, 0.00079345703f, -0.00012207031f, | 29 | -0.014038086f, 0.0064697266f, -0.002532959f, 0.00079345703f, -0.00012207031f, |
| 30 | }; | 30 | }; |
| 31 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc3{ | 31 | static constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc3{ |
| 32 | 0.6298828f, -0.19274902f, 0.09725952f, -0.05319214f, 0.028625488f, | 32 | 0.6298828f, -0.19274902f, 0.09725952f, -0.05319214f, 0.028625488f, |
| 33 | -0.014373779f, 0.006500244f, -0.0024719238f, 0.0007324219f, -0.000091552734f, | 33 | -0.014373779f, 0.006500244f, -0.0024719238f, 0.0007324219f, -0.000091552734f, |
| 34 | }; | 34 | }; |
| 35 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc4{ | 35 | static constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc4{ |
| 36 | 0.4057312f, -0.1468811f, 0.07601929f, -0.041656494f, 0.022216797f, | 36 | 0.4057312f, -0.1468811f, 0.07601929f, -0.041656494f, 0.022216797f, |
| 37 | -0.011016846f, 0.004852295f, -0.0017700195f, 0.00048828125f, -0.000030517578f, | 37 | -0.011016846f, 0.004852295f, -0.0017700195f, 0.00048828125f, -0.000030517578f, |
| 38 | }; | 38 | }; |
| 39 | constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc5{ | 39 | static constexpr std::array<Common::FixedPoint<17, 15>, WindowSize> WindowedSinc5{ |
| 40 | 0.1854248f, -0.075164795f, 0.03967285f, -0.021728516f, 0.011474609f, | 40 | 0.1854248f, -0.075164795f, 0.03967285f, -0.021728516f, 0.011474609f, |
| 41 | -0.005584717f, 0.0024108887f, -0.0008239746f, 0.00021362305f, 0.0f, | 41 | -0.005584717f, 0.0024108887f, -0.0008239746f, 0.00021362305f, 0.0f, |
| 42 | }; | 42 | }; |
diff --git a/src/audio_core/renderer/system_manager.cpp b/src/audio_core/renderer/system_manager.cpp index f66b2b890..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_) { | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | void SystemManager::ThreadFunc() { | 96 | void SystemManager::ThreadFunc() { |
| 97 | constexpr char name[]{"AudioRenderSystemManager"}; | 97 | static constexpr char name[]{"AudioRenderSystemManager"}; |
| 98 | MicroProfileOnThreadCreate(name); | 98 | MicroProfileOnThreadCreate(name); |
| 99 | Common::SetCurrentThreadName(name); | 99 | Common::SetCurrentThreadName(name); |
| 100 | Common::SetCurrentThreadPriority(Common::ThreadPriority::High); | 100 | Common::SetCurrentThreadPriority(Common::ThreadPriority::High); |
diff --git a/src/audio_core/sink/sink_stream.cpp b/src/audio_core/sink/sink_stream.cpp index 06c2a876e..2fb5f9758 100644 --- a/src/audio_core/sink/sink_stream.cpp +++ b/src/audio_core/sink/sink_stream.cpp | |||
| @@ -35,7 +35,7 @@ void SinkStream::AppendBuffer(SinkBuffer& buffer, std::vector<s16>& samples) { | |||
| 35 | 35 | ||
| 36 | if (system_channels == 6 && device_channels == 2) { | 36 | if (system_channels == 6 && device_channels == 2) { |
| 37 | // We're given 6 channels, but our device only outputs 2, so downmix. | 37 | // We're given 6 channels, but our device only outputs 2, so downmix. |
| 38 | constexpr std::array<f32, 4> down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; | 38 | static constexpr std::array<f32, 4> down_mix_coeff{1.0f, 0.707f, 0.251f, 0.707f}; |
| 39 | 39 | ||
| 40 | for (u32 read_index = 0, write_index = 0; read_index < samples.size(); | 40 | for (u32 read_index = 0, write_index = 0; read_index < samples.size(); |
| 41 | read_index += system_channels, write_index += device_channels) { | 41 | read_index += system_channels, write_index += device_channels) { |
| @@ -202,7 +202,7 @@ void SinkStream::ProcessAudioOutAndRender(std::span<s16> output_buffer, std::siz | |||
| 202 | // If we're paused or going to shut down, we don't want to consume buffers as coretiming is | 202 | // If we're paused or going to shut down, we don't want to consume buffers as coretiming is |
| 203 | // paused and we'll desync, so just play silence. | 203 | // paused and we'll desync, so just play silence. |
| 204 | if (system.IsPaused() || system.IsShuttingDown()) { | 204 | if (system.IsPaused() || system.IsShuttingDown()) { |
| 205 | constexpr std::array<s16, 6> silence{}; | 205 | static constexpr std::array<s16, 6> silence{}; |
| 206 | for (size_t i = frames_written; i < num_frames; i++) { | 206 | for (size_t i = frames_written; i < num_frames; i++) { |
| 207 | std::memcpy(&output_buffer[i * frame_size], &silence[0], frame_size_bytes); | 207 | std::memcpy(&output_buffer[i * frame_size], &silence[0], frame_size_bytes); |
| 208 | } | 208 | } |
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 6bac6722f..3a63b52e3 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -45,7 +45,7 @@ CoreTiming::~CoreTiming() { | |||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | void CoreTiming::ThreadEntry(CoreTiming& instance) { | 47 | void CoreTiming::ThreadEntry(CoreTiming& instance) { |
| 48 | constexpr char name[] = "HostTiming"; | 48 | static constexpr char name[] = "HostTiming"; |
| 49 | MicroProfileOnThreadCreate(name); | 49 | MicroProfileOnThreadCreate(name); |
| 50 | Common::SetCurrentThreadName(name); | 50 | Common::SetCurrentThreadName(name); |
| 51 | Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); | 51 | Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical); |
diff --git a/src/core/debugger/gdbstub_arch.cpp b/src/core/debugger/gdbstub_arch.cpp index 4bef09bd7..831c48513 100644 --- a/src/core/debugger/gdbstub_arch.cpp +++ b/src/core/debugger/gdbstub_arch.cpp | |||
| @@ -41,9 +41,8 @@ static void PutSIMDRegister(std::array<u32, 64>& simd_regs, size_t offset, const | |||
| 41 | 41 | ||
| 42 | // For sample XML files see the GDB source /gdb/features | 42 | // For sample XML files see the GDB source /gdb/features |
| 43 | // This XML defines what the registers are for this specific ARM device | 43 | // This XML defines what the registers are for this specific ARM device |
| 44 | std::string GDBStubA64::GetTargetXML() const { | 44 | std::string_view GDBStubA64::GetTargetXML() const { |
| 45 | constexpr const char* target_xml = | 45 | return R"(<?xml version="1.0"?> |
| 46 | R"(<?xml version="1.0"?> | ||
| 47 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> | 46 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> |
| 48 | <target version="1.0"> | 47 | <target version="1.0"> |
| 49 | <architecture>aarch64</architecture> | 48 | <architecture>aarch64</architecture> |
| @@ -178,8 +177,6 @@ std::string GDBStubA64::GetTargetXML() const { | |||
| 178 | <reg name="fpcr" bitsize="32"/> | 177 | <reg name="fpcr" bitsize="32"/> |
| 179 | </feature> | 178 | </feature> |
| 180 | </target>)"; | 179 | </target>)"; |
| 181 | |||
| 182 | return target_xml; | ||
| 183 | } | 180 | } |
| 184 | 181 | ||
| 185 | std::string GDBStubA64::RegRead(const Kernel::KThread* thread, size_t id) const { | 182 | std::string GDBStubA64::RegRead(const Kernel::KThread* thread, size_t id) const { |
| @@ -270,9 +267,8 @@ u32 GDBStubA64::BreakpointInstruction() const { | |||
| 270 | return 0xd4200000; | 267 | return 0xd4200000; |
| 271 | } | 268 | } |
| 272 | 269 | ||
| 273 | std::string GDBStubA32::GetTargetXML() const { | 270 | std::string_view GDBStubA32::GetTargetXML() const { |
| 274 | constexpr const char* target_xml = | 271 | return R"(<?xml version="1.0"?> |
| 275 | R"(<?xml version="1.0"?> | ||
| 276 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> | 272 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> |
| 277 | <target version="1.0"> | 273 | <target version="1.0"> |
| 278 | <architecture>arm</architecture> | 274 | <architecture>arm</architecture> |
| @@ -378,8 +374,6 @@ std::string GDBStubA32::GetTargetXML() const { | |||
| 378 | <reg name="fpscr" bitsize="32" type="int" group="float" regnum="80"/> | 374 | <reg name="fpscr" bitsize="32" type="int" group="float" regnum="80"/> |
| 379 | </feature> | 375 | </feature> |
| 380 | </target>)"; | 376 | </target>)"; |
| 381 | |||
| 382 | return target_xml; | ||
| 383 | } | 377 | } |
| 384 | 378 | ||
| 385 | std::string GDBStubA32::RegRead(const Kernel::KThread* thread, size_t id) const { | 379 | std::string GDBStubA32::RegRead(const Kernel::KThread* thread, size_t id) const { |
diff --git a/src/core/debugger/gdbstub_arch.h b/src/core/debugger/gdbstub_arch.h index 2540d6456..34530c788 100644 --- a/src/core/debugger/gdbstub_arch.h +++ b/src/core/debugger/gdbstub_arch.h | |||
| @@ -16,7 +16,7 @@ namespace Core { | |||
| 16 | class GDBStubArch { | 16 | class GDBStubArch { |
| 17 | public: | 17 | public: |
| 18 | virtual ~GDBStubArch() = default; | 18 | virtual ~GDBStubArch() = default; |
| 19 | virtual std::string GetTargetXML() const = 0; | 19 | virtual std::string_view GetTargetXML() const = 0; |
| 20 | virtual std::string RegRead(const Kernel::KThread* thread, size_t id) const = 0; | 20 | virtual std::string RegRead(const Kernel::KThread* thread, size_t id) const = 0; |
| 21 | virtual void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const = 0; | 21 | virtual void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const = 0; |
| 22 | virtual std::string ReadRegisters(const Kernel::KThread* thread) const = 0; | 22 | virtual std::string ReadRegisters(const Kernel::KThread* thread) const = 0; |
| @@ -27,7 +27,7 @@ public: | |||
| 27 | 27 | ||
| 28 | class GDBStubA64 final : public GDBStubArch { | 28 | class GDBStubA64 final : public GDBStubArch { |
| 29 | public: | 29 | public: |
| 30 | std::string GetTargetXML() const override; | 30 | std::string_view GetTargetXML() const override; |
| 31 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; | 31 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; |
| 32 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; | 32 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; |
| 33 | std::string ReadRegisters(const Kernel::KThread* thread) const override; | 33 | std::string ReadRegisters(const Kernel::KThread* thread) const override; |
| @@ -47,7 +47,7 @@ private: | |||
| 47 | 47 | ||
| 48 | class GDBStubA32 final : public GDBStubArch { | 48 | class GDBStubA32 final : public GDBStubArch { |
| 49 | public: | 49 | public: |
| 50 | std::string GetTargetXML() const override; | 50 | std::string_view GetTargetXML() const override; |
| 51 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; | 51 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; |
| 52 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; | 52 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; |
| 53 | std::string ReadRegisters(const Kernel::KThread* thread) const override; | 53 | std::string ReadRegisters(const Kernel::KThread* thread) const override; |
diff --git a/src/core/file_sys/ips_layer.cpp b/src/core/file_sys/ips_layer.cpp index 5aab428bb..efdf18cee 100644 --- a/src/core/file_sys/ips_layer.cpp +++ b/src/core/file_sys/ips_layer.cpp | |||
| @@ -41,12 +41,12 @@ static IPSFileType IdentifyMagic(const std::vector<u8>& magic) { | |||
| 41 | return IPSFileType::Error; | 41 | return IPSFileType::Error; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | constexpr std::array<u8, 5> patch_magic{{'P', 'A', 'T', 'C', 'H'}}; | 44 | static constexpr std::array<u8, 5> patch_magic{{'P', 'A', 'T', 'C', 'H'}}; |
| 45 | if (std::equal(magic.begin(), magic.end(), patch_magic.begin())) { | 45 | if (std::equal(magic.begin(), magic.end(), patch_magic.begin())) { |
| 46 | return IPSFileType::IPS; | 46 | return IPSFileType::IPS; |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | constexpr std::array<u8, 5> ips32_magic{{'I', 'P', 'S', '3', '2'}}; | 49 | static constexpr std::array<u8, 5> ips32_magic{{'I', 'P', 'S', '3', '2'}}; |
| 50 | if (std::equal(magic.begin(), magic.end(), ips32_magic.begin())) { | 50 | if (std::equal(magic.begin(), magic.end(), ips32_magic.begin())) { |
| 51 | return IPSFileType::IPS32; | 51 | return IPSFileType::IPS32; |
| 52 | } | 52 | } |
| @@ -55,12 +55,12 @@ static IPSFileType IdentifyMagic(const std::vector<u8>& magic) { | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | static bool IsEOF(IPSFileType type, const std::vector<u8>& data) { | 57 | static bool IsEOF(IPSFileType type, const std::vector<u8>& data) { |
| 58 | constexpr std::array<u8, 3> eof{{'E', 'O', 'F'}}; | 58 | static constexpr std::array<u8, 3> eof{{'E', 'O', 'F'}}; |
| 59 | if (type == IPSFileType::IPS && std::equal(data.begin(), data.end(), eof.begin())) { | 59 | if (type == IPSFileType::IPS && std::equal(data.begin(), data.end(), eof.begin())) { |
| 60 | return true; | 60 | return true; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | constexpr std::array<u8, 4> eeof{{'E', 'E', 'O', 'F'}}; | 63 | static constexpr std::array<u8, 4> eeof{{'E', 'E', 'O', 'F'}}; |
| 64 | return type == IPSFileType::IPS32 && std::equal(data.begin(), data.end(), eeof.begin()); | 64 | return type == IPSFileType::IPS32 && std::equal(data.begin(), data.end(), eeof.begin()); |
| 65 | } | 65 | } |
| 66 | 66 | ||
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 878d832c2..a6960170c 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp | |||
| @@ -71,7 +71,7 @@ static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bo | |||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | static std::string GetCNMTName(TitleType type, u64 title_id) { | 73 | static std::string GetCNMTName(TitleType type, u64 title_id) { |
| 74 | constexpr std::array<const char*, 9> TITLE_TYPE_NAMES{ | 74 | static constexpr std::array<const char*, 9> TITLE_TYPE_NAMES{ |
| 75 | "SystemProgram", | 75 | "SystemProgram", |
| 76 | "SystemData", | 76 | "SystemData", |
| 77 | "SystemUpdate", | 77 | "SystemUpdate", |
diff --git a/src/core/hle/kernel/svc/svc_activity.cpp b/src/core/hle/kernel/svc/svc_activity.cpp index 1dcdb7a15..baafefaeb 100644 --- a/src/core/hle/kernel/svc/svc_activity.cpp +++ b/src/core/hle/kernel/svc/svc_activity.cpp | |||
| @@ -16,7 +16,7 @@ Result SetThreadActivity(Core::System& system, Handle thread_handle, | |||
| 16 | thread_activity); | 16 | thread_activity); |
| 17 | 17 | ||
| 18 | // Validate the activity. | 18 | // Validate the activity. |
| 19 | constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { | 19 | static constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { |
| 20 | return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; | 20 | return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; |
| 21 | }; | 21 | }; |
| 22 | R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); | 22 | R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 3a96611b6..83c862b4d 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -1569,7 +1569,7 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { | |||
| 1569 | const auto& version = res.first->GetVersionString(); | 1569 | const auto& version = res.first->GetVersionString(); |
| 1570 | std::copy(version.begin(), version.end(), version_string.begin()); | 1570 | std::copy(version.begin(), version.end(), version_string.begin()); |
| 1571 | } else { | 1571 | } else { |
| 1572 | constexpr char default_version[]{"1.0.0"}; | 1572 | static constexpr char default_version[]{"1.0.0"}; |
| 1573 | std::memcpy(version_string.data(), default_version, sizeof(default_version)); | 1573 | std::memcpy(version_string.data(), default_version, sizeof(default_version)); |
| 1574 | } | 1574 | } |
| 1575 | 1575 | ||
diff --git a/src/core/hle/service/apm/apm_controller.cpp b/src/core/hle/service/apm/apm_controller.cpp index d6de84066..227fdd0cf 100644 --- a/src/core/hle/service/apm/apm_controller.cpp +++ b/src/core/hle/service/apm/apm_controller.cpp | |||
| @@ -56,7 +56,7 @@ void Controller::SetPerformanceConfiguration(PerformanceMode mode, | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { | 58 | void Controller::SetFromCpuBoostMode(CpuBoostMode mode) { |
| 59 | constexpr std::array<PerformanceConfiguration, 3> BOOST_MODE_TO_CONFIG_MAP{{ | 59 | static constexpr std::array<PerformanceConfiguration, 3> BOOST_MODE_TO_CONFIG_MAP{{ |
| 60 | PerformanceConfiguration::Config7, | 60 | PerformanceConfiguration::Config7, |
| 61 | PerformanceConfiguration::Config13, | 61 | PerformanceConfiguration::Config13, |
| 62 | PerformanceConfiguration::Config15, | 62 | PerformanceConfiguration::Config15, |
diff --git a/src/core/hle/service/nvdrv/core/syncpoint_manager.h b/src/core/hle/service/nvdrv/core/syncpoint_manager.h index 4f2cefae5..7728ff596 100644 --- a/src/core/hle/service/nvdrv/core/syncpoint_manager.h +++ b/src/core/hle/service/nvdrv/core/syncpoint_manager.h | |||
| @@ -124,7 +124,7 @@ private: | |||
| 124 | //!< value | 124 | //!< value |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | constexpr static std::size_t SyncpointCount{192}; | 127 | static constexpr std::size_t SyncpointCount{192}; |
| 128 | std::array<SyncpointInfo, SyncpointCount> syncpoints{}; | 128 | std::array<SyncpointInfo, SyncpointCount> syncpoints{}; |
| 129 | std::mutex reservation_lock; | 129 | std::mutex reservation_lock; |
| 130 | 130 | ||
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index f9ada7c93..973f7837a 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -286,7 +286,7 @@ static constexpr int TransitionTime(int year, Rule rule, int offset) { | |||
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static bool ParsePosixName(const char* name, TimeZoneRule& rule) { | 288 | static bool ParsePosixName(const char* name, TimeZoneRule& rule) { |
| 289 | constexpr char default_rule[]{",M4.1.0,M10.5.0"}; | 289 | static constexpr char default_rule[]{",M4.1.0,M10.5.0"}; |
| 290 | const char* std_name{name}; | 290 | const char* std_name{name}; |
| 291 | int std_len{}; | 291 | int std_len{}; |
| 292 | int offset{}; | 292 | int offset{}; |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 8d5f2be2f..9178b00ca 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -34,7 +34,7 @@ static u64 GenerateTelemetryId() { | |||
| 34 | mbedtls_entropy_context entropy; | 34 | mbedtls_entropy_context entropy; |
| 35 | mbedtls_entropy_init(&entropy); | 35 | mbedtls_entropy_init(&entropy); |
| 36 | mbedtls_ctr_drbg_context ctr_drbg; | 36 | mbedtls_ctr_drbg_context ctr_drbg; |
| 37 | constexpr std::array<char, 18> personalization{{"yuzu Telemetry ID"}}; | 37 | static constexpr std::array<char, 18> personalization{{"yuzu Telemetry ID"}}; |
| 38 | 38 | ||
| 39 | mbedtls_ctr_drbg_init(&ctr_drbg); | 39 | mbedtls_ctr_drbg_init(&ctr_drbg); |
| 40 | ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, | 40 | ASSERT(mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, |
diff --git a/src/input_common/drivers/joycon.cpp b/src/input_common/drivers/joycon.cpp index afc33db57..b4cd39a20 100644 --- a/src/input_common/drivers/joycon.cpp +++ b/src/input_common/drivers/joycon.cpp | |||
| @@ -390,7 +390,7 @@ void Joycons::OnMotionUpdate(std::size_t port, Joycon::ControllerType type, int | |||
| 390 | void Joycons::OnRingConUpdate(f32 ring_data) { | 390 | void Joycons::OnRingConUpdate(f32 ring_data) { |
| 391 | // To simplify ring detection it will always be mapped to an empty identifier for all | 391 | // To simplify ring detection it will always be mapped to an empty identifier for all |
| 392 | // controllers | 392 | // controllers |
| 393 | constexpr PadIdentifier identifier = { | 393 | static constexpr PadIdentifier identifier = { |
| 394 | .guid = Common::UUID{}, | 394 | .guid = Common::UUID{}, |
| 395 | .port = 0, | 395 | .port = 0, |
| 396 | .pad = 0, | 396 | .pad = 0, |
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index 88cacd615..5c20b3426 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp | |||
| @@ -616,7 +616,7 @@ bool SDLDriver::IsVibrationEnabled(const PadIdentifier& identifier) { | |||
| 616 | const auto joystick = | 616 | const auto joystick = |
| 617 | GetSDLJoystickByGUID(identifier.guid.RawString(), static_cast<int>(identifier.port)); | 617 | GetSDLJoystickByGUID(identifier.guid.RawString(), static_cast<int>(identifier.port)); |
| 618 | 618 | ||
| 619 | constexpr Common::Input::VibrationStatus test_vibration{ | 619 | static constexpr Common::Input::VibrationStatus test_vibration{ |
| 620 | .low_amplitude = 1, | 620 | .low_amplitude = 1, |
| 621 | .low_frequency = 160.0f, | 621 | .low_frequency = 160.0f, |
| 622 | .high_amplitude = 1, | 622 | .high_amplitude = 1, |
| @@ -624,7 +624,7 @@ bool SDLDriver::IsVibrationEnabled(const PadIdentifier& identifier) { | |||
| 624 | .type = Common::Input::VibrationAmplificationType::Exponential, | 624 | .type = Common::Input::VibrationAmplificationType::Exponential, |
| 625 | }; | 625 | }; |
| 626 | 626 | ||
| 627 | constexpr Common::Input::VibrationStatus zero_vibration{ | 627 | static constexpr Common::Input::VibrationStatus zero_vibration{ |
| 628 | .low_amplitude = 0, | 628 | .low_amplitude = 0, |
| 629 | .low_frequency = 160.0f, | 629 | .low_frequency = 160.0f, |
| 630 | .high_amplitude = 0, | 630 | .high_amplitude = 0, |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index ae9da6290..7195f2bc1 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -258,7 +258,7 @@ u32 Maxwell3D::GetMaxCurrentVertices() { | |||
| 258 | size_t Maxwell3D::EstimateIndexBufferSize() { | 258 | size_t Maxwell3D::EstimateIndexBufferSize() { |
| 259 | GPUVAddr start_address = regs.index_buffer.StartAddress(); | 259 | GPUVAddr start_address = regs.index_buffer.StartAddress(); |
| 260 | GPUVAddr end_address = regs.index_buffer.EndAddress(); | 260 | GPUVAddr end_address = regs.index_buffer.EndAddress(); |
| 261 | constexpr std::array<size_t, 4> max_sizes = { | 261 | static constexpr std::array<size_t, 4> max_sizes = { |
| 262 | std::numeric_limits<u8>::max(), std::numeric_limits<u16>::max(), | 262 | std::numeric_limits<u8>::max(), std::numeric_limits<u16>::max(), |
| 263 | std::numeric_limits<u32>::max(), std::numeric_limits<u32>::max()}; | 263 | std::numeric_limits<u32>::max(), std::numeric_limits<u32>::max()}; |
| 264 | const size_t byte_size = regs.index_buffer.FormatSizeInBytes(); | 264 | const size_t byte_size = regs.index_buffer.FormatSizeInBytes(); |
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index 9ebfb6179..cf56392ef 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h | |||
| @@ -216,7 +216,7 @@ private: | |||
| 216 | std::vector<u64> big_page_continous; | 216 | std::vector<u64> big_page_continous; |
| 217 | std::vector<std::pair<VAddr, std::size_t>> page_stash{}; | 217 | std::vector<std::pair<VAddr, std::size_t>> page_stash{}; |
| 218 | 218 | ||
| 219 | constexpr static size_t continous_bits = 64; | 219 | static constexpr size_t continous_bits = 64; |
| 220 | 220 | ||
| 221 | const size_t unique_identifier; | 221 | const size_t unique_identifier; |
| 222 | std::unique_ptr<VideoCommon::InvalidationAccumulator> accumulator; | 222 | std::unique_ptr<VideoCommon::InvalidationAccumulator> accumulator; |
diff --git a/src/video_core/renderer_vulkan/vk_smaa.cpp b/src/video_core/renderer_vulkan/vk_smaa.cpp index 8eb735489..f8735189d 100644 --- a/src/video_core/renderer_vulkan/vk_smaa.cpp +++ b/src/video_core/renderer_vulkan/vk_smaa.cpp | |||
| @@ -468,7 +468,7 @@ VkWriteDescriptorSet CreateWriteDescriptorSet(std::vector<VkDescriptorImageInfo> | |||
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image) { | 470 | void ClearColorImage(vk::CommandBuffer& cmdbuf, VkImage image) { |
| 471 | constexpr std::array<VkImageSubresourceRange, 1> subresources{{{ | 471 | static constexpr std::array<VkImageSubresourceRange, 1> subresources{{{ |
| 472 | .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, | 472 | .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, |
| 473 | .baseMipLevel = 0, | 473 | .baseMipLevel = 0, |
| 474 | .levelCount = 1, | 474 | .levelCount = 1, |
| @@ -528,8 +528,8 @@ SMAA::SMAA(const Device& device, MemoryAllocator& allocator, size_t image_count, | |||
| 528 | } | 528 | } |
| 529 | 529 | ||
| 530 | void SMAA::CreateImages() { | 530 | void SMAA::CreateImages() { |
| 531 | constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; | 531 | static constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; |
| 532 | constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; | 532 | static constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; |
| 533 | 533 | ||
| 534 | std::tie(m_static_images[Area], m_static_buffer_commits[Area]) = | 534 | std::tie(m_static_images[Area], m_static_buffer_commits[Area]) = |
| 535 | CreateWrappedImage(m_device, m_allocator, area_extent, VK_FORMAT_R8G8_UNORM); | 535 | CreateWrappedImage(m_device, m_allocator, area_extent, VK_FORMAT_R8G8_UNORM); |
| @@ -586,12 +586,12 @@ void SMAA::CreateSampler() { | |||
| 586 | 586 | ||
| 587 | void SMAA::CreateShaders() { | 587 | void SMAA::CreateShaders() { |
| 588 | // These match the order of the SMAAStage enum | 588 | // These match the order of the SMAAStage enum |
| 589 | constexpr std::array vert_shader_sources{ | 589 | static constexpr std::array vert_shader_sources{ |
| 590 | ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_VERT_SPV), | 590 | ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_VERT_SPV), |
| 591 | ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_VERT_SPV), | 591 | ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_VERT_SPV), |
| 592 | ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_VERT_SPV), | 592 | ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_VERT_SPV), |
| 593 | }; | 593 | }; |
| 594 | constexpr std::array frag_shader_sources{ | 594 | static constexpr std::array frag_shader_sources{ |
| 595 | ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_FRAG_SPV), | 595 | ARRAY_TO_SPAN(SMAA_EDGE_DETECTION_FRAG_SPV), |
| 596 | ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_FRAG_SPV), | 596 | ARRAY_TO_SPAN(SMAA_BLENDING_WEIGHT_CALCULATION_FRAG_SPV), |
| 597 | ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_FRAG_SPV), | 597 | ARRAY_TO_SPAN(SMAA_NEIGHBORHOOD_BLENDING_FRAG_SPV), |
| @@ -675,8 +675,8 @@ void SMAA::UploadImages(Scheduler& scheduler) { | |||
| 675 | return; | 675 | return; |
| 676 | } | 676 | } |
| 677 | 677 | ||
| 678 | constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; | 678 | static constexpr VkExtent2D area_extent{AREATEX_WIDTH, AREATEX_HEIGHT}; |
| 679 | constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; | 679 | static constexpr VkExtent2D search_extent{SEARCHTEX_WIDTH, SEARCHTEX_HEIGHT}; |
| 680 | 680 | ||
| 681 | UploadImage(m_device, m_allocator, scheduler, m_static_images[Area], area_extent, | 681 | UploadImage(m_device, m_allocator, scheduler, m_static_images[Area], area_extent, |
| 682 | VK_FORMAT_R8G8_UNORM, ARRAY_TO_SPAN(areaTexBytes)); | 682 | VK_FORMAT_R8G8_UNORM, ARRAY_TO_SPAN(areaTexBytes)); |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index b9ee83de7..0ce39616f 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h | |||
| @@ -113,7 +113,7 @@ public: | |||
| 113 | std::optional<ASTCDecoderPass> astc_decoder_pass; | 113 | std::optional<ASTCDecoderPass> astc_decoder_pass; |
| 114 | const Settings::ResolutionScalingInfo& resolution; | 114 | const Settings::ResolutionScalingInfo& resolution; |
| 115 | 115 | ||
| 116 | constexpr static size_t indexing_slots = 8 * sizeof(size_t); | 116 | static constexpr size_t indexing_slots = 8 * sizeof(size_t); |
| 117 | std::array<vk::Buffer, indexing_slots> buffers{}; | 117 | std::array<vk::Buffer, indexing_slots> buffers{}; |
| 118 | std::array<std::unique_ptr<MemoryCommit>, indexing_slots> buffer_commits{}; | 118 | std::array<std::unique_ptr<MemoryCommit>, indexing_slots> buffer_commits{}; |
| 119 | }; | 119 | }; |
diff --git a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp index c42594149..db04943eb 100644 --- a/src/video_core/renderer_vulkan/vk_turbo_mode.cpp +++ b/src/video_core/renderer_vulkan/vk_turbo_mode.cpp | |||
| @@ -48,7 +48,7 @@ void TurboMode::Run(std::stop_token stop_token) { | |||
| 48 | auto commit = m_allocator.Commit(buffer, MemoryUsage::DeviceLocal); | 48 | auto commit = m_allocator.Commit(buffer, MemoryUsage::DeviceLocal); |
| 49 | 49 | ||
| 50 | // Create the descriptor pool to contain our descriptor. | 50 | // Create the descriptor pool to contain our descriptor. |
| 51 | constexpr VkDescriptorPoolSize pool_size{ | 51 | static constexpr VkDescriptorPoolSize pool_size{ |
| 52 | .type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, | 52 | .type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 53 | .descriptorCount = 1, | 53 | .descriptorCount = 1, |
| 54 | }; | 54 | }; |
| @@ -63,7 +63,7 @@ void TurboMode::Run(std::stop_token stop_token) { | |||
| 63 | }); | 63 | }); |
| 64 | 64 | ||
| 65 | // Create the descriptor set layout from the pool. | 65 | // Create the descriptor set layout from the pool. |
| 66 | constexpr VkDescriptorSetLayoutBinding layout_binding{ | 66 | static constexpr VkDescriptorSetLayoutBinding layout_binding{ |
| 67 | .binding = 0, | 67 | .binding = 0, |
| 68 | .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, | 68 | .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, |
| 69 | .descriptorCount = 1, | 69 | .descriptorCount = 1, |
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 59120cd09..95bcdd37b 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -29,7 +29,7 @@ constexpr u32 pdep(u32 value) { | |||
| 29 | 29 | ||
| 30 | template <u32 mask, u32 incr_amount> | 30 | template <u32 mask, u32 incr_amount> |
| 31 | void incrpdep(u32& value) { | 31 | void incrpdep(u32& value) { |
| 32 | constexpr u32 swizzled_incr = pdep<mask>(incr_amount); | 32 | static constexpr u32 swizzled_incr = pdep<mask>(incr_amount); |
| 33 | value = ((value | ~mask) + swizzled_incr) & mask; | 33 | value = ((value | ~mask) + swizzled_incr) & mask; |
| 34 | } | 34 | } |
| 35 | 35 | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c278d8dab..7629904b3 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -219,7 +219,7 @@ static void LogRuntimes() { | |||
| 219 | #ifdef _MSC_VER | 219 | #ifdef _MSC_VER |
| 220 | // It is possible that the name of the dll will change. | 220 | // It is possible that the name of the dll will change. |
| 221 | // vcruntime140.dll is for 2015 and onwards | 221 | // vcruntime140.dll is for 2015 and onwards |
| 222 | constexpr char runtime_dll_name[] = "vcruntime140.dll"; | 222 | static constexpr char runtime_dll_name[] = "vcruntime140.dll"; |
| 223 | UINT sz = GetFileVersionInfoSizeA(runtime_dll_name, nullptr); | 223 | UINT sz = GetFileVersionInfoSizeA(runtime_dll_name, nullptr); |
| 224 | bool runtime_version_inspection_worked = false; | 224 | bool runtime_version_inspection_worked = false; |
| 225 | if (sz > 0) { | 225 | if (sz > 0) { |