From 4ffa09316d9bfc4cd178015d2763901fba38e12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 6 Aug 2021 23:01:16 +0200 Subject: [PATCH] =?UTF-8?q?Ensure=20=E2=80=98new=5Fmode=E2=80=99=20is=20in?= =?UTF-8?q?itialized;=20fixes=20compiler=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit wlopm.c: In function ‘sync_handle_done’: wlr-output-power-management-unstable-v1.h:295:9: error: ‘new_mode’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 295 | wl_proxy_marshal((struct wl_proxy *) zwlr_output_power_v1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 296 | ZWLR_OUTPUT_POWER_V1_SET_MODE, mode); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wlopm.c:178:40: note: ‘new_mode’ was declared here 178 | enum zwlr_output_power_v1_mode new_mode; | ^~~~~~~~ --- wlopm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wlopm.c b/wlopm.c index d257199..fa2ff92 100644 --- a/wlopm.c +++ b/wlopm.c @@ -175,7 +175,7 @@ static struct Output *output_from_name (const char *str) static void output_set_power_mode (struct Output *output, enum Power_mode mode) { - enum zwlr_output_power_v1_mode new_mode; + enum zwlr_output_power_v1_mode new_mode = ZWLR_OUTPUT_POWER_V1_MODE_ON; switch (mode) { case ON: