Fix Wmaybe-uninitialized warnings

Just a couple of places which shouldn't be possible, so initialized and
added assertions to make sure.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
dev
Scott Anderson 5 years ago committed by Pekka Paalanen
parent f014964f6f
commit 60b6572b35
  1. 3
      libweston/backend-drm/modes.c
  2. 3
      libweston/backend-headless/headless.c

@ -685,7 +685,7 @@ static int
drm_output_try_add_mode(struct drm_output *output, const drmModeModeInfo *info)
{
struct weston_mode *base;
struct drm_mode *mode;
struct drm_mode *mode = NULL;
struct drm_backend *backend;
const drmModeModeInfo *chosen = NULL;
@ -699,6 +699,7 @@ drm_output_try_add_mode(struct drm_output *output, const drmModeModeInfo *info)
}
if (chosen == info) {
assert(mode);
backend = to_drm_backend(output->base.compositor);
drm_output_destroy_mode(backend, mode);
chosen = NULL;

@ -450,6 +450,9 @@ headless_backend_create(struct weston_compositor *compositor,
case HEADLESS_NOOP:
ret = noop_renderer_init(compositor);
break;
default:
assert(0 && "invalid renderer type");
ret = -1;
}
if (ret < 0)

Loading…
Cancel
Save