From a380803d377b88fa77ddda73b9ff551f9b0b0759 Mon Sep 17 00:00:00 2001 From: Quantum Date: Thu, 1 Apr 2021 04:23:13 -0400 Subject: [PATCH] [client] libdecor: fix gcc compile warnings-turned-errors This commit fixes the -Wmissing-field-initializers warning, which can only be disabled with a pragma. GCC wants us to Initialize libdecor reserved fields, which requires knowing how many reserved fields there are. This is an implementation detail, and so we can only disable the warning. This also fixes -Wincompatible-pointer-types, which is an actual bug. --- client/displayservers/Wayland/shell_libdecor.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/displayservers/Wayland/shell_libdecor.c b/client/displayservers/Wayland/shell_libdecor.c index 2c7bd4a8..8604b59d 100644 --- a/client/displayservers/Wayland/shell_libdecor.c +++ b/client/displayservers/Wayland/shell_libdecor.c @@ -46,10 +46,6 @@ static void libdecorHandleError(struct libdecor * context, enum libdecor_error e DEBUG_ERROR("Got libdecor error (%d): %s", error, message); } -static struct libdecor_interface libdecorListener = { - libdecorHandleError, -}; - static void libdecorFrameConfigure(struct libdecor_frame * frame, struct libdecor_configuration * configuration, void * opaque) { @@ -81,15 +77,22 @@ static void libdecorFrameClose(struct libdecor_frame * frame, void * opaque) app_handleCloseEvent(); } -static void libdecorFrameCommit(void * opaque) +static void libdecorFrameCommit(struct libdecor_frame * frame, void * opaque) { } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +static struct libdecor_interface libdecorListener = { + libdecorHandleError, +}; + static struct libdecor_frame_interface libdecorFrameListener = { libdecorFrameConfigure, libdecorFrameClose, libdecorFrameCommit, }; +#pragma GCC diagnostic pop bool waylandShellInit(const char * title, bool fullscreen, bool maximize, bool borderless) {