mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #13181 from tygyh/Replace-'reinterpret_cast'
Replace 'reinterpret_cast' with 'static_cast'
This commit is contained in:
@ -79,7 +79,7 @@ std::vector<BBoxType> D3DBoundingBox::Read(u32 index, u32 length)
|
||||
HRESULT hr = D3D::context->Map(m_staging_buffer.Get(), 0, D3D11_MAP_READ, 0, &map);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
std::memcpy(values.data(), reinterpret_cast<const u8*>(map.pData) + sizeof(BBoxType) * index,
|
||||
std::memcpy(values.data(), static_cast<const u8*>(map.pData) + sizeof(BBoxType) * index,
|
||||
sizeof(BBoxType) * length);
|
||||
|
||||
D3D::context->Unmap(m_staging_buffer.Get(), 0);
|
||||
|
@ -244,7 +244,7 @@ void VertexManager::CommitBuffer(u32 num_vertices, u32 vertex_stride, u32 num_in
|
||||
*out_base_index = (cursor + vertexBufferSize) / sizeof(u16);
|
||||
|
||||
D3D::context->Map(m_buffers[m_current_buffer].Get(), 0, MapType, 0, &map);
|
||||
u8* mappedData = reinterpret_cast<u8*>(map.pData);
|
||||
u8* mappedData = static_cast<u8*>(map.pData);
|
||||
if (vertexBufferSize > 0)
|
||||
std::memcpy(mappedData + cursor, m_base_buffer_pointer, vertexBufferSize);
|
||||
if (indexBufferSize > 0)
|
||||
|
@ -327,7 +327,7 @@ bool DXStagingTexture::Map()
|
||||
if (FAILED(hr))
|
||||
return false;
|
||||
|
||||
m_map_pointer = reinterpret_cast<char*>(sr.pData);
|
||||
m_map_pointer = static_cast<char*>(sr.pData);
|
||||
m_map_stride = sr.RowPitch;
|
||||
return true;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ std::vector<BBoxType> D3D12BoundingBox::Read(u32 index, u32 length)
|
||||
return values;
|
||||
|
||||
// Copy out the values we want
|
||||
std::memcpy(values.data(), reinterpret_cast<const u8*>(mapped_pointer) + sizeof(BBoxType) * index,
|
||||
std::memcpy(values.data(), static_cast<const u8*>(mapped_pointer) + sizeof(BBoxType) * index,
|
||||
sizeof(BBoxType) * length);
|
||||
|
||||
static constexpr D3D12_RANGE write_range = {0, 0};
|
||||
|
@ -305,7 +305,7 @@ void DXTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8*
|
||||
{
|
||||
const u8* src_ptr = buffer;
|
||||
const u32 copy_size = std::min(source_stride, upload_stride);
|
||||
u8* dst_ptr = reinterpret_cast<u8*>(upload_buffer_ptr);
|
||||
u8* dst_ptr = static_cast<u8*>(upload_buffer_ptr);
|
||||
for (u32 i = 0; i < num_rows; i++)
|
||||
{
|
||||
std::memcpy(dst_ptr, src_ptr, copy_size);
|
||||
|
@ -55,7 +55,7 @@ std::vector<BBoxType> OGLBoundingBox::Read(u32 index, u32 length)
|
||||
GL_MAP_READ_BIT);
|
||||
if (ptr)
|
||||
{
|
||||
std::memcpy(values.data(), reinterpret_cast<const u8*>(ptr) + sizeof(BBoxType) * index,
|
||||
std::memcpy(values.data(), static_cast<const u8*>(ptr) + sizeof(BBoxType) * index,
|
||||
sizeof(BBoxType) * length);
|
||||
|
||||
glUnmapBuffer(GL_SHADER_STORAGE_BUFFER);
|
||||
|
@ -462,7 +462,7 @@ std::unique_ptr<OGLStagingTexture> OGLStagingTexture::Create(StagingTextureType
|
||||
}
|
||||
|
||||
glBufferStorage(target, buffer_size, nullptr, buffer_flags);
|
||||
buffer_ptr = reinterpret_cast<char*>(glMapBufferRange(target, 0, buffer_size, map_flags));
|
||||
buffer_ptr = static_cast<char*>(glMapBufferRange(target, 0, buffer_size, map_flags));
|
||||
ASSERT(buffer_ptr != nullptr);
|
||||
}
|
||||
else
|
||||
@ -639,7 +639,7 @@ bool OGLStagingTexture::Map()
|
||||
else
|
||||
flags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;
|
||||
glBindBuffer(m_target, m_buffer_name);
|
||||
m_map_pointer = reinterpret_cast<char*>(glMapBufferRange(m_target, 0, m_buffer_size, flags));
|
||||
m_map_pointer = static_cast<char*>(glMapBufferRange(m_target, 0, m_buffer_size, flags));
|
||||
glBindBuffer(m_target, 0);
|
||||
return m_map_pointer != nullptr;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ bool StagingBuffer::AllocateBuffer(STAGING_BUFFER_TYPE type, VkDeviceSize size,
|
||||
}
|
||||
}
|
||||
|
||||
*out_map_ptr = reinterpret_cast<char*>(alloc_info.pMappedData);
|
||||
*out_map_ptr = static_cast<char*>(alloc_info.pMappedData);
|
||||
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ bool StreamBuffer::AllocateBuffer()
|
||||
// Replace with the new buffer
|
||||
m_buffer = buffer;
|
||||
m_alloc = alloc;
|
||||
m_host_pointer = reinterpret_cast<u8*>(alloc_info.pMappedData);
|
||||
m_host_pointer = static_cast<u8*>(alloc_info.pMappedData);
|
||||
m_current_offset = 0;
|
||||
m_current_gpu_position = 0;
|
||||
m_tracked_fences.clear();
|
||||
|
@ -47,7 +47,7 @@ VkSurfaceKHR SwapChain::CreateVulkanSurface(VkInstance instance, const WindowSys
|
||||
nullptr, // const void* pNext
|
||||
0, // VkWin32SurfaceCreateFlagsKHR flags
|
||||
nullptr, // HINSTANCE hinstance
|
||||
reinterpret_cast<HWND>(wsi.render_surface) // HWND hwnd
|
||||
static_cast<HWND>(wsi.render_surface) // HWND hwnd
|
||||
};
|
||||
|
||||
VkSurfaceKHR surface;
|
||||
|
Reference in New Issue
Block a user