VertexLoaderX64: Avoid unchecked pointer cast.
This commit is contained in:
parent
21f3e97435
commit
5082a664c8
|
@ -32,12 +32,12 @@ static const u8* memory_base_ptr = (u8*)&g_main_cp_state.array_strides;
|
||||||
|
|
||||||
static OpArg MPIC(const void* ptr, X64Reg scale_reg, int scale = SCALE_1)
|
static OpArg MPIC(const void* ptr, X64Reg scale_reg, int scale = SCALE_1)
|
||||||
{
|
{
|
||||||
return MComplex(base_reg, scale_reg, scale, (s32)((u8*)ptr - memory_base_ptr));
|
return MComplex(base_reg, scale_reg, scale, PtrOffset(ptr, memory_base_ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
static OpArg MPIC(const void* ptr)
|
static OpArg MPIC(const void* ptr)
|
||||||
{
|
{
|
||||||
return MDisp(base_reg, (s32)((u8*)ptr - memory_base_ptr));
|
return MDisp(base_reg, PtrOffset(ptr, memory_base_ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att)
|
VertexLoaderX64::VertexLoaderX64(const TVtxDesc& vtx_desc, const VAT& vtx_att)
|
||||||
|
|
Loading…
Reference in New Issue