Fix compiler warnings generated by older toolchains/compiler

This fixes warnings like ``may be used uninitialized''

libweston/compositor-drm.c: In function 'drm_device_is_kms':
libweston/compositor-drm.c:6374:12: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
  b->drm.id = id;

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
dev
Marius Vlad 6 years ago
parent bc315aa288
commit 7d070ca0ba
  1. 2
      clients/terminal.c
  2. 2
      libweston/compositor-drm.c

@ -2610,7 +2610,7 @@ recompute_selection(struct terminal *terminal)
int side_margin, top_margin;
int start_x, end_x;
int cw, ch;
union utf8_char *data;
union utf8_char *data = NULL;
cw = terminal->average_width;
ch = terminal->extents.height;

@ -6680,7 +6680,7 @@ drm_device_is_kms(struct drm_backend *b, struct udev_device *device)
const char *filename = udev_device_get_devnode(device);
const char *sysnum = udev_device_get_sysnum(device);
drmModeRes *res;
int id, fd;
int id = -1, fd;
if (!filename)
return false;

Loading…
Cancel
Save