gallium: hud_context: Fix scalar initializer warning.
authorJohn Stultz <john.stultz@linaro.org>
Tue, 10 Mar 2020 03:27:35 +0000 (03:27 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Mar 2020 02:52:58 +0000 (02:52 +0000)
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>

src/gallium/auxiliary/hud/hud_context.c

index bc06265..1e2b948 100644 (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);