diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index 07053fee26..e62a0a2348 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -90,7 +90,7 @@ void SWVertexLoader::vFlush() for (u32 i = 0; i < IndexGenerator::GetIndexLen(); i++) { const u16 index = m_local_index_buffer[i]; - memset(&m_vertex, 0, sizeof(m_vertex)); + memset(static_cast(&m_vertex), 0, sizeof(m_vertex)); // Super Mario Sunshine requires those to be zero for those debug boxes. m_vertex.color = {}; diff --git a/Source/Core/VideoCommon/GXPipelineTypes.h b/Source/Core/VideoCommon/GXPipelineTypes.h index 5e9ec6e98d..8414b1af7f 100644 --- a/Source/Core/VideoCommon/GXPipelineTypes.h +++ b/Source/Core/VideoCommon/GXPipelineTypes.h @@ -35,11 +35,14 @@ struct GXPipelineUid // We use memcmp() for comparing pipelines as std::tie generates a large number of instructions, // and this map lookup can happen every draw call. However, as using memcmp() will also compare // any padding bytes, we have to ensure these are zeroed out. - GXPipelineUid() { std::memset(this, 0, sizeof(*this)); } - GXPipelineUid(const GXPipelineUid& rhs) { std::memcpy(this, &rhs, sizeof(*this)); } + GXPipelineUid() { std::memset(static_cast(this), 0, sizeof(*this)); } + GXPipelineUid(const GXPipelineUid& rhs) + { + std::memcpy(static_cast(this), &rhs, sizeof(*this)); + } GXPipelineUid& operator=(const GXPipelineUid& rhs) { - std::memcpy(this, &rhs, sizeof(*this)); + std::memcpy(static_cast(this), &rhs, sizeof(*this)); return *this; } bool operator<(const GXPipelineUid& rhs) const @@ -62,11 +65,14 @@ struct GXUberPipelineUid DepthState depth_state; BlendingState blending_state; - GXUberPipelineUid() { std::memset(this, 0, sizeof(*this)); } - GXUberPipelineUid(const GXUberPipelineUid& rhs) { std::memcpy(this, &rhs, sizeof(*this)); } + GXUberPipelineUid() { std::memset(static_cast(this), 0, sizeof(*this)); } + GXUberPipelineUid(const GXUberPipelineUid& rhs) + { + std::memcpy(static_cast(this), &rhs, sizeof(*this)); + } GXUberPipelineUid& operator=(const GXUberPipelineUid& rhs) { - std::memcpy(this, &rhs, sizeof(*this)); + std::memcpy(static_cast(this), &rhs, sizeof(*this)); return *this; } bool operator<(const GXUberPipelineUid& rhs) const diff --git a/Source/Core/VideoCommon/VertexShaderManager.cpp b/Source/Core/VideoCommon/VertexShaderManager.cpp index e01b9aa666..fca6a420c5 100644 --- a/Source/Core/VideoCommon/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/VertexShaderManager.cpp @@ -116,7 +116,7 @@ void VertexShaderManager::Init() bTexMtxInfoChanged = false; bLightingConfigChanged = false; - std::memset(&xfmem, 0, sizeof(xfmem)); + std::memset(static_cast(&xfmem), 0, sizeof(xfmem)); constants = {}; ResetView();