*We* know that these enums are equivalent, but Clang doesn't. So, tell Clang that it shouldn't care.
The remaining warnings are due to a bug in Clang around unions with enum types.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/ddraw/device.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 048ba7fba66..69b3c4d4f6c 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -2635,7 +2635,7 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface, break; }
- wined3d_stateblock_set_render_state(device->update_state, state, value); + wined3d_stateblock_set_render_state(device->update_state, (enum wined3d_render_state)state, value); break; } wined3d_mutex_unlock(); @@ -3116,7 +3116,7 @@ static HRESULT d3d_device7_SetTransform(IDirect3DDevice7 *iface, wined3d_state = WINED3D_TS_WORLD_MATRIX(3); break; default: - wined3d_state = state; + wined3d_state = (enum wined3d_transform_state)state; }
if (!matrix) @@ -3225,7 +3225,7 @@ static HRESULT d3d_device7_GetTransform(IDirect3DDevice7 *iface, wined3d_state = WINED3D_TS_WORLD_MATRIX(3); break; default: - wined3d_state = state; + wined3d_state = (enum wined3d_transform_state)state; }
if (!matrix) @@ -3329,7 +3329,7 @@ static HRESULT d3d_device7_MultiplyTransform(IDirect3DDevice7 *iface, wined3d_state = WINED3D_TS_WORLD_MATRIX(3); break; default: - wined3d_state = state; + wined3d_state = (enum wined3d_transform_state)state; }
/* Note: D3DMATRIX is compatible with struct wined3d_matrix. */ @@ -3504,7 +3504,7 @@ static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface, goto done;
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / stride, vertex_count);
@@ -3715,7 +3715,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface, wined3d_stateblock_set_index_buffer(device->state, device->index_buffer, WINED3DFMT_R16_UINT);
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / stride); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(*indices), index_count); @@ -4042,7 +4042,7 @@ static HRESULT d3d_device7_DrawPrimitiveStrided(IDirect3DDevice7 *iface, D3DPRIM goto done; wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf));
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, vb_pos / dst_stride, vertex_count);
@@ -4178,7 +4178,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface, wined3d_stateblock_set_base_vertex_index(device->state, vb_pos / vtx_dst_stride);
wined3d_stateblock_set_vertex_declaration(device->state, ddraw_find_decl(device->ddraw, fvf)); - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
@@ -4300,7 +4300,7 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE }
/* Now draw the primitives */ - wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_primitive(device->wined3d_device, start_vertex, vertex_count);
@@ -4454,7 +4454,7 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, return hr; }
- wined3d_device_set_primitive_type(device->wined3d_device, primitive_type, 0); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)primitive_type, 0); wined3d_device_apply_stateblock(device->wined3d_device, device->state); hr = wined3d_device_draw_indexed_primitive(device->wined3d_device, ib_pos / sizeof(WORD), index_count);
@@ -6005,7 +6005,7 @@ static HRESULT d3d_device7_CreateStateBlock(IDirect3DDevice7 *iface, }
/* The D3DSTATEBLOCKTYPE enum is fine here. */ - hr = wined3d_stateblock_create(device->wined3d_device, device->state, type, &wined3d_sb); + hr = wined3d_stateblock_create(device->wined3d_device, device->state, (enum wined3d_stateblock_type)type, &wined3d_sb); if (FAILED(hr)) { WARN("Failed to create stateblock, hr %#x.\n", hr);