Mesa (master): svga: fix warning: ‘uc . ui’ may be used uninitialized in this function

Marek Olšák mareko at kemper.freedesktop.org
Wed Apr 27 04:17:53 PDT 2011


Module: Mesa
Branch: master
Commit: 1e5dc6a7788f4c548fbed38813090978fdacd984
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e5dc6a7788f4c548fbed38813090978fdacd984

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Apr 27 13:02:32 2011 +0200

svga: fix warning: ‘uc.ui’ may be used uninitialized in this function

This is safe because it's initialized if buffers & PIPE_CLEAR_COLOR and
probably doesn't have any effect otherwise.

---

 src/gallium/drivers/svga/svga_pipe_clear.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c
index b288c3e..2bba777 100644
--- a/src/gallium/drivers/svga/svga_pipe_clear.c
+++ b/src/gallium/drivers/svga/svga_pipe_clear.c
@@ -46,7 +46,7 @@ try_clear(struct svga_context *svga,
    boolean restore_viewport = FALSE;
    SVGA3dClearFlag flags = 0;
    struct pipe_framebuffer_state *fb = &svga->curr.framebuffer;
-   union util_color uc;
+   union util_color uc = {0};
 
    ret = svga_update_state(svga, SVGA_STATE_HW_CLEAR);
    if (ret)



More information about the mesa-commit mailing list