Commit 417983f2 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3d9: Use the available ARRAY_SIZE() macro.

parent 1a52ba0b
...@@ -2401,7 +2401,7 @@ static HRESULT WINAPI d3d9_device_GetTextureStageState(IDirect3DDevice9Ex *iface ...@@ -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); 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); WARN("Invalid state %#x passed.\n", state);
return D3D_OK; return D3D_OK;
...@@ -2421,7 +2421,7 @@ static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface ...@@ -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); 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); WARN("Invalid state %#x passed.\n", state);
return D3D_OK; return D3D_OK;
......
...@@ -344,7 +344,7 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elem ...@@ -344,7 +344,7 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elem
for (i = 0; i < count; ++i) 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); WARN("Invalid element type %#x.\n", d3d9_elements[i].Type);
heap_free(*wined3d_elements); heap_free(*wined3d_elements);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment