gallium/auxiliary: Fix uses of gnu struct = {} extension
authorDylan Baker <dylan@pnwbakers.com>
Thu, 21 Nov 2019 17:50:27 +0000 (09:50 -0800)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 26 Nov 2019 20:48:11 +0000 (12:48 -0800)
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@google.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
src/gallium/auxiliary/hud/hud_context.c
src/gallium/auxiliary/renderonly/renderonly.c
src/gallium/auxiliary/vl/vl_bicubic_filter.c
src/gallium/auxiliary/vl/vl_compositor_cs.c
src/gallium/auxiliary/vl/vl_video_buffer.c

index f9733d2de4aa6056135e1c3b7deffff3822d279e..621ef94845562b95ffbbaf84a92aa98513f7479f 100644 (file)
@@ -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);
 
index 29ba92ae02f909e2bcda517f25aaeb5e10986561..bfb6b758fbee04ad4da4081173f4821cbe91363c 100644 (file)
@@ -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)
index 077e2131bfd74f660097d9325cd7d35d8fe72f78..5bcf65abf553f9f927d68c5e2b76a8b0041f4cba 100644 (file)
@@ -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,
index 1970861271d60f3e09f15647ebcc8553d2964245..e2bd06a870cb7667b5948cfb25b0a101c5453921 100644 (file)
@@ -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;
 
index ed331c94ad07e3382909c41e6011856664f4504c..25322242b52e6e655ab6d511f51f4d55682d2769 100644 (file)
@@ -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));