nir: use braces around subobject in initializer
authorTapani Pälli <tapani.palli@intel.com>
Tue, 23 Apr 2019 11:35:17 +0000 (14:35 +0300)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 26 Apr 2019 19:01:22 +0000 (12:01 -0700)
Used same syntax as elsewhere with Mesa sources, verified result
against MSVC with godbolt.org.

fixes following warning with clang:
   warning: suggest braces around initialization of subobject

v2: empty braces -> braces around subobject (Caio, Kristian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/compiler/nir/nir_linking_helpers.c
src/compiler/nir/nir_lower_io_to_vector.c

index ef0f94baf47bf5119aeac2c3314263a5f7351b81..faf8a1eaced149b7efac864745da22dd5b13203b 100644 (file)
@@ -476,7 +476,7 @@ gather_varying_component_info(nir_shader *consumer,
                               unsigned *varying_comp_info_size,
                               bool default_to_smooth_interp)
 {
-   unsigned store_varying_info_idx[MAX_VARYINGS_INCL_PATCH][4] = {0};
+   unsigned store_varying_info_idx[MAX_VARYINGS_INCL_PATCH][4] = {{0}};
    unsigned num_of_comps_to_pack = 0;
 
    /* Count the number of varying that can be packed and create a mapping
@@ -726,7 +726,7 @@ nir_compact_varyings(nir_shader *producer, nir_shader *consumer,
    assert(producer->info.stage != MESA_SHADER_FRAGMENT);
    assert(consumer->info.stage != MESA_SHADER_VERTEX);
 
-   struct assigned_comps assigned_comps[MAX_VARYINGS_INCL_PATCH] = {0};
+   struct assigned_comps assigned_comps[MAX_VARYINGS_INCL_PATCH] = {{0}};
 
    get_unmoveable_components_masks(&producer->outputs, assigned_comps,
                                    producer->info.stage,
index d979962373df5568def17dd86b15de555e50226f..abc89fb2f497824cb803c66cb0d9767635b0bc08 100644 (file)
@@ -197,10 +197,10 @@ nir_lower_io_to_vector_impl(nir_function_impl *impl, nir_variable_mode modes)
    nir_metadata_require(impl, nir_metadata_dominance);
 
    nir_shader *shader = impl->function->shader;
-   nir_variable *old_inputs[MAX_VARYINGS_INCL_PATCH][4] = {0};
-   nir_variable *new_inputs[MAX_VARYINGS_INCL_PATCH][4] = {0};
-   nir_variable *old_outputs[MAX_VARYINGS_INCL_PATCH][4] = {0};
-   nir_variable *new_outputs[MAX_VARYINGS_INCL_PATCH][4] = {0};
+   nir_variable *old_inputs[MAX_VARYINGS_INCL_PATCH][4] = {{0}};
+   nir_variable *new_inputs[MAX_VARYINGS_INCL_PATCH][4] = {{0}};
+   nir_variable *old_outputs[MAX_VARYINGS_INCL_PATCH][4] = {{0}};
+   nir_variable *new_outputs[MAX_VARYINGS_INCL_PATCH][4] = {{0}};
 
    if (modes & nir_var_shader_in) {
       /* Vertex shaders support overlapping inputs.  We don't do those */