~leon_plickat/wlopm

4ffa09316d9bfc4cd178015d2763901fba38e12c — Daniel Eklöf 3 months ago a385b76
Ensure ‘new_mode’ is initialized; fixes compiler warning

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;
      |                                        ^~~~~~~~
1 files changed, 1 insertions(+), 1 deletions(-)

M wlopm.c
M wlopm.c => wlopm.c +1 -1
@@ 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: