From: John Stultz Date: Tue, 10 Mar 2020 03:27:35 +0000 (+0000) Subject: gallium: hud_context: Fix scalar initializer warning. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be22995ecf868a90c6b14fce9b907cf302459e71;p=mesa.git gallium: hud_context: Fix scalar initializer warning. When trying to build mesa/master under AOSP, I've run into the following error: external/mesa3d/src/gallium/auxiliary/hud/hud_context.c:1821:31: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init] struct sigaction action = {{0}}; ^~~ 1 error generated. This patch addresses this by switching to using memset instead of using an initializer. Signed-off-by: John Stultz Tested-by: Marge Bot Part-of: --- diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index bc06265cad8..1e2b948e348 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -1818,7 +1818,9 @@ 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 = {{0}}; + struct sigaction action; + + memset(&action, 0, sizeof(action)); #endif huds_visible = debug_get_bool_option("GALLIUM_HUD_VISIBLE", TRUE); hud_scale = debug_get_num_option("GALLIUM_HUD_SCALE", 1);