From: Tapani Pälli Date: Tue, 23 Apr 2019 11:35:17 +0000 (+0300) Subject: nir: use braces around subobject in initializer X-Git-Tag: upstream/19.3.0~6893 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a7f182dac0b8f29f83a2eca02d29f10e8b23244;p=platform%2Fupstream%2Fmesa.git nir: use braces around subobject in initializer 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 Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Kristian H. Kristensen --- diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index ef0f94b..faf8a1e 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -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, diff --git a/src/compiler/nir/nir_lower_io_to_vector.c b/src/compiler/nir/nir_lower_io_to_vector.c index d979962..abc89fb 100644 --- a/src/compiler/nir/nir_lower_io_to_vector.c +++ b/src/compiler/nir/nir_lower_io_to_vector.c @@ -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 */