d3dx9: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d715814e68
commit
df722d2628
|
@ -105,7 +105,7 @@ static HRESULT WINAPI ID3DXFontImpl_GetDescA(ID3DXFont *iface, D3DXFONT_DESCA *d
|
||||||
|
|
||||||
if( !desc ) return D3DERR_INVALIDCALL;
|
if( !desc ) return D3DERR_INVALIDCALL;
|
||||||
memcpy(desc, &This->desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName));
|
memcpy(desc, &This->desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName));
|
||||||
WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, sizeof(desc->FaceName) / sizeof(CHAR), NULL, NULL);
|
WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, ARRAY_SIZE(desc->FaceName), NULL, NULL);
|
||||||
|
|
||||||
return D3D_OK;
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
@ -284,8 +284,7 @@ HRESULT WINAPI D3DXCreateFontIndirectA(IDirect3DDevice9 *device, const D3DXFONT_
|
||||||
/* Copy everything but the last structure member. This requires the
|
/* Copy everything but the last structure member. This requires the
|
||||||
two D3DXFONT_DESC structures to be equal until the FaceName member */
|
two D3DXFONT_DESC structures to be equal until the FaceName member */
|
||||||
memcpy(&widedesc, desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName));
|
memcpy(&widedesc, desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName));
|
||||||
MultiByteToWideChar(CP_ACP, 0, desc->FaceName, -1,
|
MultiByteToWideChar(CP_ACP, 0, desc->FaceName, -1, widedesc.FaceName, ARRAY_SIZE(widedesc.FaceName));
|
||||||
widedesc.FaceName, sizeof(widedesc.FaceName)/sizeof(WCHAR));
|
|
||||||
return D3DXCreateFontIndirectW(device, &widedesc, font);
|
return D3DXCreateFontIndirectW(device, &widedesc, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue