mirror of
https://git.sr.ht/~leon_plickat/wlopm
synced 2026-01-28 05:49:23 +01:00
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;
| ^~~~~~~~
This commit is contained in:
committed by
Leon Henrik Plickat
parent
a385b761bd
commit
4ffa09316d
2
wlopm.c
2
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:
|
||||
|
||||
Reference in New Issue
Block a user