diff --git a/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp b/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp index b8513df344..661398b351 100644 --- a/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp +++ b/Source/Core/Core/IOS/USB/USB_HID/HIDv4.cpp @@ -208,7 +208,7 @@ static void CopyDescriptorToBuffer(std::vector* buffer, T descriptor) descriptor.Swap(); buffer->insert(buffer->end(), reinterpret_cast(&descriptor), reinterpret_cast(&descriptor) + size); - const size_t number_of_padding_bytes = Common::AlignUp(size, 4) - size; + constexpr size_t number_of_padding_bytes = Common::AlignUp(size, 4) - size; buffer->insert(buffer->end(), number_of_padding_bytes, 0); } diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp index a81fae3dc1..5d1a6ed21d 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_LoadStorePaired.cpp @@ -61,8 +61,8 @@ template SType ScaleAndClamp(double ps, u32 stScale) { float convPS = (float)ps * m_quantizeTable[stScale]; - float min = (float)std::numeric_limits::min(); - float max = (float)std::numeric_limits::max(); + constexpr float min = (float)std::numeric_limits::min(); + constexpr float max = (float)std::numeric_limits::max(); return (SType)std::clamp(convPS, min, max); } diff --git a/Source/Core/VideoBackends/D3D12/VertexManager.cpp b/Source/Core/VideoBackends/D3D12/VertexManager.cpp index bdf5fbe8e8..ecaec7c9c1 100644 --- a/Source/Core/VideoBackends/D3D12/VertexManager.cpp +++ b/Source/Core/VideoBackends/D3D12/VertexManager.cpp @@ -195,10 +195,10 @@ void VertexManager::UploadAllConstants() { // We are free to re-use parts of the buffer now since we're uploading all constants. const u32 pixel_constants_offset = 0; - const u32 vertex_constants_offset = + constexpr u32 vertex_constants_offset = Common::AlignUp(pixel_constants_offset + sizeof(PixelShaderConstants), D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT); - const u32 geometry_constants_offset = + constexpr u32 geometry_constants_offset = Common::AlignUp(vertex_constants_offset + sizeof(VertexShaderConstants), D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT); const u32 allocation_size = geometry_constants_offset + sizeof(GeometryShaderConstants);