From 6122432aa773bcb3b922ad50074cdee280cdd1bb Mon Sep 17 00:00:00 2001 From: Joshua Achorn Date: Mon, 20 Mar 2023 15:57:42 -0400 Subject: [PATCH] style(gx): use a less paranoid memcpy in CGxDevice::BufData --- src/gx/d3d/CGxDeviceD3d.cpp | 2 +- src/gx/gll/CGxDeviceGLL.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gx/d3d/CGxDeviceD3d.cpp b/src/gx/d3d/CGxDeviceD3d.cpp index 3b9c958..5d4a808 100644 --- a/src/gx/d3d/CGxDeviceD3d.cpp +++ b/src/gx/d3d/CGxDeviceD3d.cpp @@ -398,7 +398,7 @@ void CGxDeviceD3d::BufData(CGxBuf* buf, void* data, size_t size, uintptr_t offse CGxDevice::BufData(buf, data, size, offset); auto bufData = this->IBufLock(buf); - memcpy(reinterpret_cast(uintptr_t(bufData) + offset)), data, size); + memcpy(&bufData[offset], data, size); this->IBufUnlock(buf); } diff --git a/src/gx/gll/CGxDeviceGLL.cpp b/src/gx/gll/CGxDeviceGLL.cpp index d158eb8..f82890d 100644 --- a/src/gx/gll/CGxDeviceGLL.cpp +++ b/src/gx/gll/CGxDeviceGLL.cpp @@ -121,7 +121,7 @@ void CGxDeviceGLL::BufData(CGxBuf* buf, void* data, size_t size, uintptr_t offse CGxDevice::BufData(buf, data, size, offset); auto bufData = this->IBufLock(buf); - memcpy(reinterpret_cast(uintptr_t(bufData) + offset), data, size); + memcpy(&bufData[offset], data, size); this->IBufUnlock(buf); }