From 43d482b20a558a521e51aba49baf87b1440cc724 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aida=20Jonikien=C4=97?= <aidas957@gmail.com>
Date: Sun, 21 Jan 2024 19:49:36 +0200
Subject: [PATCH 2/6] Fix warnings in various patchsets (part 2)

This fixes the remaining non-test warnings on my Arch Linux (BTW)
system with the freshest GCC versions

Note: There are still some warnings in upstream code (I made a MR
for them but they've been ignored)
---
 ...d-implicit-cast-of-interface-pointer.patch | 102 ++++++++++++++----
 ...d-implicit-cast-of-interface-pointer.patch |  46 ++++++--
 ...d-implicit-cast-of-interface-pointer.patch | 102 +++++++++++++++---
 ...d-implicit-cast-of-interface-pointer.patch |  34 ------
 ...d-implicit-cast-of-interface-pointer.patch |  31 ++++++
 ...d-implicit-cast-of-interface-pointer.patch |  62 +++++++++++
 6 files changed, 300 insertions(+), 77 deletions(-)
 delete mode 100644 patches/Compiler_Warnings/0036-d2d1-Avoid-implicit-cast-of-interface-pointer.patch
 create mode 100644 patches/Compiler_Warnings/0041-combase-Avoid-implicit-cast-of-interface-pointer.patch
 create mode 100644 patches/Compiler_Warnings/0042-vkd3d-Avoid-implicit-cast-of-interface-pointer.patch

diff --git a/patches/Compiler_Warnings/0021-d2d1-Avoid-implicit-cast-of-interface-pointer.patch b/patches/Compiler_Warnings/0021-d2d1-Avoid-implicit-cast-of-interface-pointer.patch
index 83eb1b5e..cc7473f4 100644
--- a/patches/Compiler_Warnings/0021-d2d1-Avoid-implicit-cast-of-interface-pointer.patch
+++ b/patches/Compiler_Warnings/0021-d2d1-Avoid-implicit-cast-of-interface-pointer.patch
@@ -1,30 +1,33 @@
-From 4edf58f26172ec7f931eab57d14aca564d8b58e3 Mon Sep 17 00:00:00 2001
+From 7d3e7406a3ac7e6db03c72fae26442100d45eb54 Mon Sep 17 00:00:00 2001
 From: Sebastian Lackner <sebastian@fds-team.de>
 Date: Tue, 22 Mar 2016 21:54:26 +0100
 Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
 
 ---
- dlls/d2d1/bitmap.c             | 2 +-
- dlls/d2d1/brush.c              | 8 ++++----
- dlls/d2d1/dc_render_target.c   | 2 +-
- dlls/d2d1/geometry.c           | 8 ++++----
- dlls/d2d1/hwnd_render_target.c | 2 +-
- dlls/d2d1/state_block.c        | 2 +-
- 6 files changed, 12 insertions(+), 12 deletions(-)
+ dlls/d2d1/bitmap.c             |  2 +-
+ dlls/d2d1/brush.c              |  8 ++++----
+ dlls/d2d1/d2d1_private.h       |  2 +-
+ dlls/d2d1/dc_render_target.c   |  2 +-
+ dlls/d2d1/factory.c            |  2 +-
+ dlls/d2d1/geometry.c           | 12 ++++++------
+ dlls/d2d1/hwnd_render_target.c |  2 +-
+ dlls/d2d1/state_block.c        |  2 +-
+ dlls/d2d1/stroke.c             |  2 +-
+ 9 files changed, 17 insertions(+), 17 deletions(-)
 
 diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
-index 1cba26f5ca4..df88fb70469 100644
+index e5048611519..fe97fd855b8 100644
 --- a/dlls/d2d1/bitmap.c
 +++ b/dlls/d2d1/bitmap.c
-@@ -762,5 +762,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
+@@ -771,5 +771,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
      if (!iface)
          return NULL;
      assert(iface->lpVtbl == (ID2D1BitmapVtbl *)&d2d_bitmap_vtbl);
 -    return CONTAINING_RECORD(iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
-+    return CONTAINING_RECORD((ID2D1Bitmap1*)iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
++    return CONTAINING_RECORD((ID2D1Bitmap1 *)iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
  }
 diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
-index 98aa889aa5f..52fc0a9854a 100644
+index 75cd72b5b9f..314123373b7 100644
 --- a/dlls/d2d1/brush.c
 +++ b/dlls/d2d1/brush.c
 @@ -259,7 +259,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
@@ -63,8 +66,21 @@ index 98aa889aa5f..52fc0a9854a 100644
  }
  
  static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush1 *iface,
+diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
+index 36bedf8331c..caf82e65c62 100644
+--- a/dlls/d2d1/d2d1_private.h
++++ b/dlls/d2d1/d2d1_private.h
+@@ -699,7 +699,7 @@ struct d2d_factory
+ 
+ static inline struct d2d_factory *unsafe_impl_from_ID2D1Factory(ID2D1Factory *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory3_iface);
++    return CONTAINING_RECORD((ID2D1Factory3 *)iface, struct d2d_factory, ID2D1Factory3_iface);
+ }
+ 
+ void d2d_effects_init_builtins(struct d2d_factory *factory);
 diff --git a/dlls/d2d1/dc_render_target.c b/dlls/d2d1/dc_render_target.c
-index 30eafe361d1..0a38aa8613a 100644
+index aa0c715baa5..8974425b39f 100644
 --- a/dlls/d2d1/dc_render_target.c
 +++ b/dlls/d2d1/dc_render_target.c
 @@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
@@ -72,12 +88,25 @@ index 30eafe361d1..0a38aa8613a 100644
  static inline struct d2d_dc_render_target *impl_from_IUnknown(IUnknown *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d2d_dc_render_target, ID2D1DCRenderTarget_iface);
-+    return CONTAINING_RECORD((ID2D1DCRenderTarget*)iface, struct d2d_dc_render_target, ID2D1DCRenderTarget_iface);
++    return CONTAINING_RECORD((ID2D1DCRenderTarget *)iface, struct d2d_dc_render_target, ID2D1DCRenderTarget_iface);
  }
  
  static HRESULT d2d_dc_render_target_present(IUnknown *outer_unknown)
+diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c
+index d349da376fc..0f67200a7c5 100644
+--- a/dlls/d2d1/factory.c
++++ b/dlls/d2d1/factory.c
+@@ -38,7 +38,7 @@ static void d2d_effect_registration_cleanup(struct d2d_effect_registration *reg)
+ 
+ static inline struct d2d_factory *impl_from_ID2D1Factory3(ID2D1Factory3 *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory3_iface);
++    return CONTAINING_RECORD((ID2D1Factory3 *)iface, struct d2d_factory, ID2D1Factory3_iface);
+ }
+ 
+ static inline struct d2d_factory *impl_from_ID2D1Multithread(ID2D1Multithread *iface)
 diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
-index d6ee91de005..781e9aa8511 100644
+index d6ee91de005..d36f447f373 100644
 --- a/dlls/d2d1/geometry.c
 +++ b/dlls/d2d1/geometry.c
 @@ -3360,7 +3360,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
@@ -89,6 +118,15 @@ index d6ee91de005..781e9aa8511 100644
  }
  
  static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry1 *iface, REFIID iid, void **out)
+@@ -3961,7 +3961,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
+ 
+ static inline struct d2d_geometry *impl_from_ID2D1EllipseGeometry(ID2D1EllipseGeometry *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
++    return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface);
+ }
+ 
+ static HRESULT STDMETHODCALLTYPE d2d_ellipse_geometry_QueryInterface(ID2D1EllipseGeometry *iface,
 @@ -4233,7 +4233,7 @@ fail:
  
  static inline struct d2d_geometry *impl_from_ID2D1RectangleGeometry(ID2D1RectangleGeometry *iface)
@@ -98,6 +136,15 @@ index d6ee91de005..781e9aa8511 100644
  }
  
  static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_QueryInterface(ID2D1RectangleGeometry *iface,
+@@ -4649,7 +4649,7 @@ fail:
+ 
+ static inline struct d2d_geometry *impl_from_ID2D1RoundedRectangleGeometry(ID2D1RoundedRectangleGeometry *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
++    return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface);
+ }
+ 
+ static HRESULT STDMETHODCALLTYPE d2d_rounded_rectangle_geometry_QueryInterface(ID2D1RoundedRectangleGeometry *iface,
 @@ -4945,7 +4945,7 @@ fail:
  
  static inline struct d2d_geometry *impl_from_ID2D1TransformedGeometry(ID2D1TransformedGeometry *iface)
@@ -112,12 +159,12 @@ index d6ee91de005..781e9aa8511 100644
  static inline struct d2d_geometry *impl_from_ID2D1GeometryGroup(ID2D1GeometryGroup *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
-+    return CONTAINING_RECORD( (ID2D1Geometry*)iface, struct d2d_geometry, ID2D1Geometry_iface);
++    return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface);
  }
  
  static HRESULT STDMETHODCALLTYPE d2d_geometry_group_QueryInterface(ID2D1GeometryGroup *iface,
 diff --git a/dlls/d2d1/hwnd_render_target.c b/dlls/d2d1/hwnd_render_target.c
-index 4d3fe43a1b3..ccb7067fabf 100644
+index 7f16ff00d4e..ae84e9e0e69 100644
 --- a/dlls/d2d1/hwnd_render_target.c
 +++ b/dlls/d2d1/hwnd_render_target.c
 @@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
@@ -125,12 +172,12 @@ index 4d3fe43a1b3..ccb7067fabf 100644
  static inline struct d2d_hwnd_render_target *impl_from_IUnknown(IUnknown *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d2d_hwnd_render_target, ID2D1HwndRenderTarget_iface);
-+    return CONTAINING_RECORD((ID2D1HwndRenderTarget*)iface, struct d2d_hwnd_render_target, ID2D1HwndRenderTarget_iface);
++    return CONTAINING_RECORD((ID2D1HwndRenderTarget *)iface, struct d2d_hwnd_render_target, ID2D1HwndRenderTarget_iface);
  }
  
  static HRESULT d2d_hwnd_render_target_present(IUnknown *outer_unknown)
 diff --git a/dlls/d2d1/state_block.c b/dlls/d2d1/state_block.c
-index 770c165fd90..a3b48095436 100644
+index 770c165fd90..10da4f0d544 100644
 --- a/dlls/d2d1/state_block.c
 +++ b/dlls/d2d1/state_block.c
 @@ -191,5 +191,5 @@ struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStat
@@ -138,8 +185,21 @@ index 770c165fd90..a3b48095436 100644
          return NULL;
      }
 -    return CONTAINING_RECORD(iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
-+    return CONTAINING_RECORD((ID2D1DrawingStateBlock1*)iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
++    return CONTAINING_RECORD((ID2D1DrawingStateBlock1 *)iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
+ }
+diff --git a/dlls/d2d1/stroke.c b/dlls/d2d1/stroke.c
+index fc12d4eb972..7ce8a769b75 100644
+--- a/dlls/d2d1/stroke.c
++++ b/dlls/d2d1/stroke.c
+@@ -196,7 +196,7 @@ struct d2d_stroke_style *unsafe_impl_from_ID2D1StrokeStyle(ID2D1StrokeStyle *ifa
+     if (!iface)
+         return NULL;
+     assert((const struct ID2D1StrokeStyle1Vtbl *)iface->lpVtbl == &d2d_stroke_style_vtbl);
+-    return CONTAINING_RECORD(iface, struct d2d_stroke_style, ID2D1StrokeStyle1_iface);
++    return CONTAINING_RECORD((ID2D1StrokeStyle1 *)iface, struct d2d_stroke_style, ID2D1StrokeStyle1_iface);
  }
+ 
+ HRESULT d2d_stroke_style_init(struct d2d_stroke_style *style, ID2D1Factory *factory,
 -- 
-2.38.1
+2.43.0
 
diff --git a/patches/Compiler_Warnings/0026-dwrite-Avoid-implicit-cast-of-interface-pointer.patch b/patches/Compiler_Warnings/0026-dwrite-Avoid-implicit-cast-of-interface-pointer.patch
index 99984983..85de2325 100644
--- a/patches/Compiler_Warnings/0026-dwrite-Avoid-implicit-cast-of-interface-pointer.patch
+++ b/patches/Compiler_Warnings/0026-dwrite-Avoid-implicit-cast-of-interface-pointer.patch
@@ -1,17 +1,27 @@
-From 7e3c4d732bacaeaf37ab8f32a7548715825eff4d Mon Sep 17 00:00:00 2001
+From a44478ec3e9a94a0f470d42372ccf2325d652daa Mon Sep 17 00:00:00 2001
 From: Sebastian Lackner <sebastian@fds-team.de>
 Date: Tue, 22 Mar 2016 21:58:40 +0100
 Subject: [PATCH] dwrite: Avoid implicit cast of interface pointer.
 
 ---
- dlls/dwrite/font.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ dlls/dwrite/font.c   | 8 ++++----
+ dlls/dwrite/format.c | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
-index 2296c74c1e3..2b5e18aab19 100644
+index 2028440ca8e..234c1b224ff 100644
 --- a/dlls/dwrite/font.c
 +++ b/dlls/dwrite/font.c
-@@ -2514,7 +2514,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
+@@ -633,7 +633,7 @@ static struct dwrite_fontset_builder *impl_from_IDWriteFontSetBuilder2(IDWriteFo
+ 
+ static struct dwrite_fontset *impl_from_IDWriteFontSet3(IDWriteFontSet3 *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct dwrite_fontset, IDWriteFontSet3_iface);
++    return CONTAINING_RECORD((IDWriteFontSet3 *)iface, struct dwrite_fontset, IDWriteFontSet3_iface);
+ }
+ 
+ static struct dwrite_fontset *unsafe_impl_from_IDWriteFontSet(IDWriteFontSet *iface);
+@@ -2530,7 +2530,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
      if (!iface)
          return NULL;
      assert(iface->lpVtbl == (IDWriteFontVtbl*)&dwritefontvtbl);
@@ -20,7 +30,7 @@ index 2296c74c1e3..2b5e18aab19 100644
  }
  
  struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
-@@ -2522,7 +2522,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
+@@ -2538,7 +2538,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
      if (!iface)
          return NULL;
      assert(iface->lpVtbl == (IDWriteFontFaceVtbl*)&dwritefontfacevtbl);
@@ -29,6 +39,28 @@ index 2296c74c1e3..2b5e18aab19 100644
  }
  
  static struct dwrite_fontfacereference *unsafe_impl_from_IDWriteFontFaceReference(IDWriteFontFaceReference *iface)
+@@ -8101,7 +8101,7 @@ static struct dwrite_fontset *unsafe_impl_from_IDWriteFontSet(IDWriteFontSet *if
+     if (!iface)
+         return NULL;
+     assert(iface->lpVtbl == (IDWriteFontSetVtbl *)&fontsetvtbl);
+-    return CONTAINING_RECORD(iface, struct dwrite_fontset, IDWriteFontSet3_iface);
++    return CONTAINING_RECORD((IDWriteFontSet3 *)iface, struct dwrite_fontset, IDWriteFontSet3_iface);
+ }
+ 
+ static HRESULT fontset_create_entry(IDWriteFontFile *file, DWRITE_FONT_FACE_TYPE face_type,
+diff --git a/dlls/dwrite/format.c b/dlls/dwrite/format.c
+index 01a6dfd06c9..43a58bee494 100644
+--- a/dlls/dwrite/format.c
++++ b/dlls/dwrite/format.c
+@@ -708,7 +708,7 @@ static const IDWriteTextFormat3Vtbl dwritetextformatvtbl =
+ struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextFormat *iface)
+ {
+     return (iface->lpVtbl == (IDWriteTextFormatVtbl *)&dwritetextformatvtbl) ?
+-        CONTAINING_RECORD(iface, struct dwrite_textformat, IDWriteTextFormat3_iface) : NULL;
++        CONTAINING_RECORD((IDWriteTextFormat3 *)iface, struct dwrite_textformat, IDWriteTextFormat3_iface) : NULL;
+ }
+ 
+ HRESULT create_text_format(const WCHAR *family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight,
 -- 
-2.34.1
+2.43.0
 
diff --git a/patches/Compiler_Warnings/0035-d3d10-Avoid-implicit-cast-of-interface-pointer.patch b/patches/Compiler_Warnings/0035-d3d10-Avoid-implicit-cast-of-interface-pointer.patch
index 401359cd..69b1e5d5 100644
--- a/patches/Compiler_Warnings/0035-d3d10-Avoid-implicit-cast-of-interface-pointer.patch
+++ b/patches/Compiler_Warnings/0035-d3d10-Avoid-implicit-cast-of-interface-pointer.patch
@@ -1,61 +1,133 @@
-From 34109c1adac6293a87db004d60d342faeb33fcfe Mon Sep 17 00:00:00 2001
+From a57b701de001e2c5b729bccd19269bb51bc885a8 Mon Sep 17 00:00:00 2001
 From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
 Date: Tue, 8 Jun 2021 09:34:28 +1000
 Subject: [PATCH] d3d10: Avoid implicit cast of interface pointer.
 
 ---
- dlls/d3d10/effect.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ dlls/d3d10/effect.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
 
 diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c
-index 3b4050460a0..b03ed2d6c89 100644
+index 6e2b67bb700..2bb49e6fb99 100644
 --- a/dlls/d3d10/effect.c
 +++ b/dlls/d3d10/effect.c
-@@ -147,7 +147,7 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D1
+@@ -151,7 +151,7 @@ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVariable(ID3D1
  
  static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderVariable(ID3D10EffectShaderVariable *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
-+    return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
  }
  
  static struct d3d10_effect_variable * d3d10_array_get_element(struct d3d10_effect_variable *v,
-@@ -4876,7 +4876,7 @@ static void read_variable_array_from_buffer(struct d3d10_effect_variable *variab
+@@ -5978,7 +5978,7 @@ static const struct ID3D10EffectVariableVtbl d3d10_effect_variable_vtbl =
+ /* ID3D10EffectVariable methods */
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectConstantBuffer(ID3D10EffectConstantBuffer *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_constant_buffer_IsValid(ID3D10EffectConstantBuffer *iface)
+@@ -6429,7 +6429,7 @@ static void read_variable_array_from_buffer(struct d3d10_effect_variable *variab
  
  static inline struct d3d10_effect_variable *impl_from_ID3D10EffectScalarVariable(ID3D10EffectScalarVariable *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
-+    return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
  }
  
  static BOOL STDMETHODCALLTYPE d3d10_effect_scalar_variable_IsValid(ID3D10EffectScalarVariable *iface)
-@@ -5212,7 +5212,7 @@ static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_
+@@ -6767,7 +6767,7 @@ static const struct ID3D10EffectScalarVariableVtbl d3d10_effect_scalar_variable_
  
  static inline struct d3d10_effect_variable *impl_from_ID3D10EffectVectorVariable(ID3D10EffectVectorVariable *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
-+    return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
  }
  
  static BOOL STDMETHODCALLTYPE d3d10_effect_vector_variable_IsValid(ID3D10EffectVectorVariable *iface)
-@@ -5699,7 +5699,7 @@ static void read_matrix_variable_array_from_buffer(struct d3d10_effect_variable
+@@ -7256,7 +7256,7 @@ static void read_matrix_variable_array_from_buffer(struct d3d10_effect_variable
  
  static inline struct d3d10_effect_variable *impl_from_ID3D10EffectMatrixVariable(ID3D10EffectMatrixVariable *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
-+    return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
  }
  
  static BOOL STDMETHODCALLTYPE d3d10_effect_matrix_variable_IsValid(ID3D10EffectMatrixVariable *iface)
-@@ -6222,7 +6222,7 @@ static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10S
+@@ -7546,7 +7546,7 @@ static const struct ID3D10EffectMatrixVariableVtbl d3d10_effect_matrix_variable_
+ 
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectStringVariable(ID3D10EffectStringVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_string_variable_IsValid(ID3D10EffectStringVariable *iface)
+@@ -7783,7 +7783,7 @@ static void set_shader_resource_variable(ID3D10ShaderResourceView **src, ID3D10S
  static inline struct d3d10_effect_variable *impl_from_ID3D10EffectShaderResourceVariable(
          ID3D10EffectShaderResourceVariable *iface)
  {
 -    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
-+    return CONTAINING_RECORD((ID3D10EffectVariable*)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
  }
  
  static BOOL STDMETHODCALLTYPE d3d10_effect_shader_resource_variable_IsValid(ID3D10EffectShaderResourceVariable *iface)
+@@ -8045,7 +8045,7 @@ static const struct ID3D10EffectShaderResourceVariableVtbl d3d10_effect_shader_r
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectRenderTargetViewVariable(
+         ID3D10EffectRenderTargetViewVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_render_target_view_variable_IsValid(
+@@ -8277,7 +8277,7 @@ static const struct ID3D10EffectRenderTargetViewVariableVtbl d3d10_effect_render
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectDepthStencilViewVariable(
+         ID3D10EffectDepthStencilViewVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_view_variable_IsValid(
+@@ -8907,7 +8907,7 @@ static const struct ID3D10EffectShaderVariableVtbl d3d10_effect_shader_variable_
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectBlendVariable(
+         ID3D10EffectBlendVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_blend_variable_IsValid(ID3D10EffectBlendVariable *iface)
+@@ -9146,7 +9146,7 @@ static const struct ID3D10EffectBlendVariableVtbl d3d10_effect_blend_variable_vt
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectDepthStencilVariable(
+         ID3D10EffectDepthStencilVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_depth_stencil_variable_IsValid(ID3D10EffectDepthStencilVariable *iface)
+@@ -9387,7 +9387,7 @@ static const struct ID3D10EffectDepthStencilVariableVtbl d3d10_effect_depth_sten
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectRasterizerVariable(
+         ID3D10EffectRasterizerVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_rasterizer_variable_IsValid(ID3D10EffectRasterizerVariable *iface)
+@@ -9626,7 +9626,7 @@ static const struct ID3D10EffectRasterizerVariableVtbl d3d10_effect_rasterizer_v
+ static inline struct d3d10_effect_variable *impl_from_ID3D10EffectSamplerVariable(
+         ID3D10EffectSamplerVariable *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
++    return CONTAINING_RECORD((ID3D10EffectVariable *)iface, struct d3d10_effect_variable, ID3D10EffectVariable_iface);
+ }
+ 
+ static BOOL STDMETHODCALLTYPE d3d10_effect_sampler_variable_IsValid(ID3D10EffectSamplerVariable *iface)
 -- 
-2.33.0
+2.43.0
 
diff --git a/patches/Compiler_Warnings/0036-d2d1-Avoid-implicit-cast-of-interface-pointer.patch b/patches/Compiler_Warnings/0036-d2d1-Avoid-implicit-cast-of-interface-pointer.patch
deleted file mode 100644
index f73fe33a..00000000
--- a/patches/Compiler_Warnings/0036-d2d1-Avoid-implicit-cast-of-interface-pointer.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From dd8e8e98edf2f16a4fd4109cd283cf7949a3cb9b Mon Sep 17 00:00:00 2001
-From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
-Date: Tue, 8 Jun 2021 09:39:56 +1000
-Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
-
----
- dlls/d2d1/geometry.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
-index eb353669030..3e00edfd1b3 100644
---- a/dlls/d2d1/geometry.c
-+++ b/dlls/d2d1/geometry.c
-@@ -3615,7 +3615,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
- 
- static inline struct d2d_geometry *impl_from_ID2D1EllipseGeometry(ID2D1EllipseGeometry *iface)
- {
--    return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
-+    return CONTAINING_RECORD((ID2D1Geometry*)iface, struct d2d_geometry, ID2D1Geometry_iface);
- }
- 
- static HRESULT STDMETHODCALLTYPE d2d_ellipse_geometry_QueryInterface(ID2D1EllipseGeometry *iface,
-@@ -4237,7 +4237,7 @@ fail:
- 
- static inline struct d2d_geometry *impl_from_ID2D1RoundedRectangleGeometry(ID2D1RoundedRectangleGeometry *iface)
- {
--    return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface);
-+    return CONTAINING_RECORD((ID2D1Geometry*)iface, struct d2d_geometry, ID2D1Geometry_iface);
- }
- 
- static HRESULT STDMETHODCALLTYPE d2d_rounded_rectangle_geometry_QueryInterface(ID2D1RoundedRectangleGeometry *iface,
--- 
-2.30.2
-
diff --git a/patches/Compiler_Warnings/0041-combase-Avoid-implicit-cast-of-interface-pointer.patch b/patches/Compiler_Warnings/0041-combase-Avoid-implicit-cast-of-interface-pointer.patch
new file mode 100644
index 00000000..eb4795ab
--- /dev/null
+++ b/patches/Compiler_Warnings/0041-combase-Avoid-implicit-cast-of-interface-pointer.patch
@@ -0,0 +1,31 @@
+From eca39664fba12d414a88b700e6bc97584e896869 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Aida=20Jonikien=C4=97?= <aidas957@gmail.com>
+Date: Sun, 21 Jan 2024 19:28:08 +0200
+Subject: [PATCH 1/2] combase: Avoid implicit cast of interface pointer.
+
+---
+ dlls/combase/string.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/dlls/combase/string.c b/dlls/combase/string.c
+index 1345870cf2f..3dc8d22dc7d 100644
+--- a/dlls/combase/string.c
++++ b/dlls/combase/string.c
+@@ -55,12 +55,12 @@ static inline struct hstring_private *impl_from_HSTRING(HSTRING string)
+ 
+ static inline struct hstring_private *impl_from_HSTRING_HEADER(HSTRING_HEADER *header)
+ {
+-    return CONTAINING_RECORD(header, struct hstring_private, header);
++    return CONTAINING_RECORD((struct hstring_header *)header, struct hstring_private, header);
+ }
+ 
+ static inline struct hstring_private *impl_from_HSTRING_BUFFER(HSTRING_BUFFER buffer)
+ {
+-    return CONTAINING_RECORD(buffer, struct hstring_private, buffer);
++    return CONTAINING_RECORD((WCHAR *)buffer, struct hstring_private, buffer[0]);
+ }
+ 
+ static BOOL alloc_string(UINT32 len, HSTRING *out)
+-- 
+2.43.0
+
diff --git a/patches/Compiler_Warnings/0042-vkd3d-Avoid-implicit-cast-of-interface-pointer.patch b/patches/Compiler_Warnings/0042-vkd3d-Avoid-implicit-cast-of-interface-pointer.patch
new file mode 100644
index 00000000..2f87f1d0
--- /dev/null
+++ b/patches/Compiler_Warnings/0042-vkd3d-Avoid-implicit-cast-of-interface-pointer.patch
@@ -0,0 +1,62 @@
+From a9a08e61557c52db7613b3420425a092dc7286fb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Aida=20Jonikien=C4=97?= <aidas957@gmail.com>
+Date: Sun, 21 Jan 2024 19:38:38 +0200
+Subject: [PATCH 2/2] vkd3d: Avoid implicit cast of interface pointer.
+
+---
+ libs/vkd3d/libs/vkd3d-shader/hlsl.y   | 2 +-
+ libs/vkd3d/libs/vkd3d/command.c       | 2 +-
+ libs/vkd3d/libs/vkd3d/vkd3d_private.h | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libs/vkd3d/libs/vkd3d-shader/hlsl.y b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
+index 0dde4c18587..a717cdd408f 100644
+--- a/libs/vkd3d/libs/vkd3d-shader/hlsl.y
++++ b/libs/vkd3d/libs/vkd3d-shader/hlsl.y
+@@ -6656,7 +6656,7 @@ switch_case:
+ switch_cases:
+       switch_case
+         {
+-            struct hlsl_ir_switch_case *c = LIST_ENTRY($1, struct hlsl_ir_switch_case, entry);
++            struct hlsl_ir_switch_case *c = LIST_ENTRY((const struct list *)$1, struct hlsl_ir_switch_case, entry);
+             if (!($$ = make_empty_list(ctx)))
+             {
+                 hlsl_free_ir_switch_case(c);
+diff --git a/libs/vkd3d/libs/vkd3d/command.c b/libs/vkd3d/libs/vkd3d/command.c
+index 15c8317b191..19fda360097 100644
+--- a/libs/vkd3d/libs/vkd3d/command.c
++++ b/libs/vkd3d/libs/vkd3d/command.c
+@@ -6115,7 +6115,7 @@ static struct d3d12_command_list *unsafe_impl_from_ID3D12CommandList(ID3D12Comma
+     if (!iface)
+         return NULL;
+     assert(iface->lpVtbl == (struct ID3D12CommandListVtbl *)&d3d12_command_list_vtbl);
+-    return CONTAINING_RECORD(iface, struct d3d12_command_list, ID3D12GraphicsCommandList5_iface);
++    return CONTAINING_RECORD((ID3D12GraphicsCommandList5 *)iface, struct d3d12_command_list, ID3D12GraphicsCommandList5_iface);
+ }
+ 
+ static HRESULT d3d12_command_list_init(struct d3d12_command_list *list, struct d3d12_device *device,
+diff --git a/libs/vkd3d/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
+index f06f564d6ea..1d249f681e0 100644
+--- a/libs/vkd3d/libs/vkd3d/vkd3d_private.h
++++ b/libs/vkd3d/libs/vkd3d/vkd3d_private.h
+@@ -750,7 +750,7 @@ struct d3d12_resource
+ 
+ static inline struct d3d12_resource *impl_from_ID3D12Resource(ID3D12Resource *iface)
+ {
+-    return CONTAINING_RECORD(iface, struct d3d12_resource, ID3D12Resource1_iface);
++    return CONTAINING_RECORD((ID3D12Resource1 *)iface, struct d3d12_resource, ID3D12Resource1_iface);
+ }
+ 
+ static inline struct d3d12_resource *impl_from_ID3D12Resource1(ID3D12Resource1 *iface)
+@@ -1067,7 +1067,7 @@ void d3d12_desc_flush_vk_heap_updates_locked(struct d3d12_descriptor_heap *descr
+ 
+ static inline struct d3d12_descriptor_heap *d3d12_desc_get_descriptor_heap(const struct d3d12_desc *descriptor)
+ {
+-    return CONTAINING_RECORD(descriptor - descriptor->index, struct d3d12_descriptor_heap, descriptors);
++    return CONTAINING_RECORD((uint8_t *)descriptor - descriptor->index, struct d3d12_descriptor_heap, descriptors[0]);
+ }
+ 
+ static inline unsigned int d3d12_desc_heap_range_size(const struct d3d12_desc *descriptor)
+-- 
+2.43.0
+
-- 
2.43.0

