[PATCH 0/3] MR4135: d2d1: -Wenum-conversion warning fixes
From: Jacek Caban <jacek(a)codeweavers.com> --- dlls/d2d1/tests/d2d1.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 024886706c3..58f905ca1dc 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -2266,41 +2266,41 @@ static void test_bitmap_brush(BOOL d3d11) /* Crash on Windows 7+ */ if (0) { - ID2D1DeviceContext_DrawImage(context, NULL, NULL, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, NULL, NULL, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); } - ID2D1DeviceContext_DrawImage(context, image, NULL, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, NULL, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); set_rect(&src_rect, 0.0f, 0.0f, image_size.width, image_size.height); - ID2D1DeviceContext_DrawImage(context, image, NULL, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, NULL, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); offset.x = -1; offset.y = -1; - ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); offset.x = image_size.width * 2; offset.y = image_size.height; - ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, NULL, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); offset.x = image_size.width * 3; set_rect(&src_rect, image_size.width / 2, image_size.height / 2, image_size.width, image_size.height); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); offset.x = image_size.width * 4; set_rect(&src_rect, 0.0f, 0.0f, image_size.width * 2, image_size.height * 2); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); offset.x = image_size.width * 5; set_rect(&src_rect, image_size.width, image_size.height, 0.0f, 0.0f); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); @@ -2312,7 +2312,7 @@ static void test_bitmap_brush(BOOL d3d11) offset.x = image_size.width * 6; set_rect(&src_rect, 1.0f, 0.0f, 1.0f, image_size.height); - ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, + ID2D1DeviceContext_DrawImage(context, image, &offset, &src_rect, D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR, D2D1_COMPOSITE_MODE_SOURCE_OVER); hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4135
From: Jacek Caban <jacek(a)codeweavers.com> --- dlls/d2d1/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index a8993e79d4d..e5548878ee9 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -2544,8 +2544,7 @@ static void STDMETHODCALLTYPE d2d_device_context_DrawImage(ID2D1DeviceContext1 * if (SUCCEEDED(ID2D1Image_QueryInterface(image, &IID_ID2D1Bitmap, (void **)&bitmap))) { - d2d_device_context_draw_bitmap(context, bitmap, NULL, 1.0f, d2d1_1_interp_mode_from_d2d1(interpolation_mode), - image_rect, target_offset, NULL); + d2d_device_context_draw_bitmap(context, bitmap, NULL, 1.0f, interpolation_mode, image_rect, target_offset, NULL); ID2D1Bitmap_Release(bitmap); return; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4135
From: Jacek Caban <jacek(a)codeweavers.com> --- dlls/d2d1/factory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index fff9895e930..baa89600463 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -1326,7 +1326,7 @@ HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device, } factory_options.debugLevel = properties->debugLevel; - if (FAILED(hr = D2D1CreateFactory(properties->threadingMode, + if (FAILED(hr = D2D1CreateFactory((D2D1_FACTORY_TYPE)properties->threadingMode, &IID_ID2D1Factory1, &factory_options, (void **)&factory))) return hr; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4135
Nikolay Sivov (@nsivov) commented about dlls/d2d1/factory.c:
}
factory_options.debugLevel = properties->debugLevel; - if (FAILED(hr = D2D1CreateFactory(properties->threadingMode, + if (FAILED(hr = D2D1CreateFactory((D2D1_FACTORY_TYPE)properties->threadingMode, &IID_ID2D1Factory1, &factory_options, (void **)&factory))) return hr;
These are different enough I think, it's better to convert them explicitly, instead of a cast. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4135#note_49388
participants (3)
-
Jacek Caban -
Jacek Caban (@jacek) -
Nikolay Sivov (@nsivov)