Mesa (master): gallium/auxiliary: Fix uses of gnu struct = {} extension

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 26 21:28:42 UTC 2019


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

Author: Dylan Baker <dylan at pnwbakers.com>
Date:   Thu Nov 21 09:50:27 2019 -0800

gallium/auxiliary: Fix uses of gnu struct = {} extension

Most of these will never actually be compiled by windows, but in the
interest of being able to make using struct foo = {}; an error and
avoiding breaking windows removing a handful of safe uses seems like a
good trade off.

Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Acked-by: Eric Engestrom <eric.engestrom at intel.com>

---

 src/gallium/auxiliary/hud/hud_context.c       | 2 +-
 src/gallium/auxiliary/renderonly/renderonly.c | 4 ++--
 src/gallium/auxiliary/vl/vl_bicubic_filter.c  | 2 +-
 src/gallium/auxiliary/vl/vl_compositor_cs.c   | 6 +++---
 src/gallium/auxiliary/vl/vl_video_buffer.c    | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index f9733d2de4a..621ef948455 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1816,7 +1816,7 @@ hud_create(struct cso_context *cso, struct hud_context *share)
 #ifdef PIPE_OS_UNIX
    unsigned signo = debug_get_num_option("GALLIUM_HUD_TOGGLE_SIGNAL", 0);
    static boolean sig_handled = FALSE;
-   struct sigaction action = {};
+   struct sigaction action = {{0}};
 #endif
    huds_visible = debug_get_bool_option("GALLIUM_HUD_VISIBLE", TRUE);
 
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c
index 29ba92ae02f..bfb6b758fbe 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -55,7 +55,7 @@ void
 renderonly_scanout_destroy(struct renderonly_scanout *scanout,
 			   struct renderonly *ro)
 {
-   struct drm_mode_destroy_dumb destroy_dumb = { };
+   struct drm_mode_destroy_dumb destroy_dumb = {0};
 
    if (ro->kms_fd != -1) {
       destroy_dumb.handle = scanout->handle;
@@ -76,7 +76,7 @@ renderonly_create_kms_dumb_buffer_for_resource(struct pipe_resource *rsc,
       .height = rsc->height0,
       .bpp = util_format_get_blocksizebits(rsc->format),
    };
-   struct drm_mode_destroy_dumb destroy_dumb = { };
+   struct drm_mode_destroy_dumb destroy_dumb = {0};
 
    scanout = CALLOC_STRUCT(renderonly_scanout);
    if (!scanout)
diff --git a/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
index 077e2131bfd..5bcf65abf55 100644
--- a/src/gallium/auxiliary/vl/vl_bicubic_filter.c
+++ b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
@@ -423,7 +423,7 @@ vl_bicubic_filter_render(struct vl_bicubic_filter *filter,
    }
    viewport.scale[2] = 1;
 
-   struct pipe_constant_buffer cb = {};
+   struct pipe_constant_buffer cb = {0};
    float *ptr = NULL;
 
    u_upload_alloc(filter->pipe->const_uploader, 0, 2 * sizeof(float), 256,
diff --git a/src/gallium/auxiliary/vl/vl_compositor_cs.c b/src/gallium/auxiliary/vl/vl_compositor_cs.c
index 1970861271d..e2bd06a870c 100644
--- a/src/gallium/auxiliary/vl/vl_compositor_cs.c
+++ b/src/gallium/auxiliary/vl/vl_compositor_cs.c
@@ -588,7 +588,7 @@ cs_launch(struct vl_compositor *c,
    struct pipe_context *ctx = c->pipe;
 
    /* Bind the image */
-   struct pipe_image_view image = {};
+   struct pipe_image_view image = {0};
    image.resource = c->fb_state.cbufs[0]->texture;
    image.shader_access = image.access = PIPE_IMAGE_ACCESS_READ_WRITE;
    image.format = c->fb_state.cbufs[0]->texture->format;
@@ -599,7 +599,7 @@ cs_launch(struct vl_compositor *c,
    ctx->bind_compute_state(ctx, cs);
 
    /* Dispatch compute */
-   struct pipe_grid_info info = {};
+   struct pipe_grid_info info = {0};
    info.block[0] = 8;
    info.block[1] = 8;
    info.block[2] = 1;
@@ -741,7 +741,7 @@ vl_compositor_cs_create_shader(struct vl_compositor *c,
       return NULL;
    }
 
-   struct pipe_compute_state state = {};
+   struct pipe_compute_state state = {0};
    state.ir_type = PIPE_SHADER_IR_TGSI;
    state.prog = tokens;
 
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index ed331c94ad0..25322242b52 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -461,7 +461,7 @@ struct pipe_video_buffer *
 vl_video_buffer_create_as_resource(struct pipe_context *pipe,
                                    const struct pipe_video_buffer *tmpl)
 {
-   struct pipe_resource templ, *resources[VL_NUM_COMPONENTS] = {};
+   struct pipe_resource templ, *resources[VL_NUM_COMPONENTS] = {0};
    unsigned array_size =  tmpl->interlaced ? 2 : 1;
 
    memset(&templ, 0, sizeof(templ));




More information about the mesa-commit mailing list