Initialize roots_output to fix -Wmaybe-uninitialized

With -O2:
../rootston/desktop.c: In function ‘desktop_surface_at’:
../rootston/desktop.c:714:18: error: ‘roots_output’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if ((surface = layer_surface_at(roots_output,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      &roots_output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM],
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ox, oy, sx, sy))) {
      ~~~~~~~~~~~~~~~
This commit is contained in:
Orestis Floros 2018-03-31 12:55:36 +03:00
parent 8ed0e9f343
commit 3f6823092a
No known key found for this signature in database
GPG key ID: E9AD9F32E401E38F

View file

@ -682,7 +682,7 @@ struct wlr_surface *desktop_surface_at(struct roots_desktop *desktop,
struct wlr_surface *surface = NULL; struct wlr_surface *surface = NULL;
struct wlr_output *wlr_output = struct wlr_output *wlr_output =
wlr_output_layout_output_at(desktop->layout, lx, ly); wlr_output_layout_output_at(desktop->layout, lx, ly);
struct roots_output *roots_output; struct roots_output *roots_output = NULL;
double ox = lx, oy = ly; double ox = lx, oy = ly;
*view = NULL; *view = NULL;