[PATCH 1/2] wined3d: Initialize a RECT to avoid compiler warnings.

Michael Stefaniuc mstefani at redhat.de
Sun May 15 19:48:03 CDT 2016


Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
Don't like it but this seems to be the only way to stop this warnings.
Using SetRectEmpty() before or in prepare_ds_clear() doesn't makes it go
away.

dlls/wined3d/device.c: In function ‘device_clear_render_targets’:
dlls/wined3d/device.c:394:9: warning: ‘ds_rect.bottom’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         surface_modify_ds_location(depth_stencil, location, ds_rect.right, ds_rect.bottom);
         ^
dlls/wined3d/device.c:305:10: note: ‘ds_rect.bottom’ was declared here
     RECT ds_rect;
          ^
dlls/wined3d/device.c:394:9: warning: ‘ds_rect.right’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         surface_modify_ds_location(depth_stencil, location, ds_rect.right, ds_rect.bottom);
         ^
dlls/wined3d/device.c:305:10: note: ‘ds_rect.right’ was declared here
     RECT ds_rect;
          ^



 dlls/wined3d/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d1f77ca..fa33667 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -302,7 +302,7 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
     GLbitfield clear_mask = 0;
     BOOL render_offscreen;
     unsigned int i;
-    RECT ds_rect;
+    RECT ds_rect = {0};
 
     context = context_acquire(device, target);
     if (!context->valid)
-- 
2.4.11



More information about the wine-patches mailing list