d3d9: Use the available ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-02-20 23:57:12 +01:00 committed by Alexandre Julliard
parent 1a52ba0bc8
commit 417983f2da
2 changed files with 3 additions and 3 deletions

View File

@ -2401,7 +2401,7 @@ static HRESULT WINAPI d3d9_device_GetTextureStageState(IDirect3DDevice9Ex *iface
TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, state, value);
if (state >= sizeof(tss_lookup) / sizeof(*tss_lookup))
if (state >= ARRAY_SIZE(tss_lookup))
{
WARN("Invalid state %#x passed.\n", state);
return D3D_OK;
@ -2421,7 +2421,7 @@ static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface
TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, state, value);
if (state >= sizeof(tss_lookup) / sizeof(*tss_lookup))
if (state >= ARRAY_SIZE(tss_lookup))
{
WARN("Invalid state %#x passed.\n", state);
return D3D_OK;

View File

@ -344,7 +344,7 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elem
for (i = 0; i < count; ++i)
{
if (d3d9_elements[i].Type >= (sizeof(d3d_dtype_lookup) / sizeof(*d3d_dtype_lookup)))
if (d3d9_elements[i].Type >= ARRAY_SIZE(d3d_dtype_lookup))
{
WARN("Invalid element type %#x.\n", d3d9_elements[i].Type);
heap_free(*wined3d_elements);