From c26317ebd6c42fcd70a63c2a95d04f11f3c15bd5 Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Fri, 22 May 2020 14:47:30 -0700 Subject: [PATCH] mesa/st: Use memset to zero out struct MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is a non-stop source of warnings and build breakage. memset works everywhere. src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c:354:45: warning: suggest braces around initialization of subobject [-Wmissing-braces] Reviewed-by: Rob Clark Reviewed-by: Marek Olšák Part-of: --- src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c b/src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c index 2b8ed079f81..14bb4b975db 100644 --- a/src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c +++ b/src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c @@ -351,10 +351,11 @@ st_tgsi_lower_depth_clamp(const struct tgsi_token *tokens, int depth_range_const, bool clip_negative_one_to_one) { - struct tgsi_depth_clamp_transform ctx = {0}; + struct tgsi_depth_clamp_transform ctx; struct tgsi_token *newtoks; int newlen; + memset(&ctx, 0, sizeof(ctx)); tgsi_scan_shader(tokens, &ctx.info); /* we only want to do this for the fragment shader, and the shader-stage -- 2.30.2