Mesa (master): gallium/util: use memset() to initialize vars to avoid warnings

Brian Paul brianp at kemper.freedesktop.org
Thu Mar 11 15:52:17 UTC 2010


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

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Mar 11 08:51:18 2010 -0700

gallium/util: use memset() to initialize vars to avoid warnings

---

 src/gallium/auxiliary/util/u_blitter.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 33d0908..36d5824 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -106,9 +106,9 @@ struct blitter_context_priv
 struct blitter_context *util_blitter_create(struct pipe_context *pipe)
 {
    struct blitter_context_priv *ctx;
-   struct pipe_blend_state blend = { 0 };
-   struct pipe_depth_stencil_alpha_state dsa = { { 0 } };
-   struct pipe_rasterizer_state rs_state = { 0 };
+   struct pipe_blend_state blend;
+   struct pipe_depth_stencil_alpha_state dsa;
+   struct pipe_rasterizer_state rs_state;
    struct pipe_sampler_state *sampler_state;
    struct pipe_vertex_element velem[2];
    unsigned i;
@@ -131,12 +131,14 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe)
    ctx->blitter.saved_num_sampler_states = ~0;
 
    /* blend state objects */
+   memset(&blend, 0, sizeof(blend));
    ctx->blend_keep_color = pipe->create_blend_state(pipe, &blend);
 
    blend.rt[0].colormask = PIPE_MASK_RGBA;
    ctx->blend_write_color = pipe->create_blend_state(pipe, &blend);
 
    /* depth stencil alpha state objects */
+   memset(&dsa, 0, sizeof(dsa));
    ctx->dsa_keep_depth_stencil =
       pipe->create_depth_stencil_alpha_state(pipe, &dsa);
 




More information about the mesa-commit mailing list