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 <john.stultz@linaro.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4141>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4141>
This commit is contained in:
John Stultz 2020-03-10 03:27:35 +00:00 committed by Marge Bot
parent 09fbde830f
commit be22995ecf
1 changed files with 3 additions and 1 deletions

View File

@ -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);