libweston: weston_output_init(..., +name)
Add 'name' argument to weston_output_init(). This is much more obvious
than the assert inside weston_output_init() to ensure the caller has set
a field in weston_output first.
Now weston_output_init() will strdup() the name itself, which means we
can drop a whole bunch of strdup()s in the backends. This matches
weston_output_destroy() which was already calling free() on the name.
All backends are slightly reordered to call weston_output_init() before
accessing any fields of weston_output, except the Wayland backend which
would make it a little awkward to do it in this patch. Mind, that
weston_output_init() still does not reset the struct to zero - it is
presumed the caller has done it, since weston_output is embedded in the
backend output structs.
Signed-off-by:
Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Showing
- libweston/compositor-drm.c 5 additions, 3 deletionslibweston/compositor-drm.c
- libweston/compositor-fbdev.c 2 additions, 3 deletionslibweston/compositor-fbdev.c
- libweston/compositor-headless.c 2 additions, 2 deletionslibweston/compositor-headless.c
- libweston/compositor-rdp.c 2 additions, 2 deletionslibweston/compositor-rdp.c
- libweston/compositor-wayland.c 3 additions, 4 deletionslibweston/compositor-wayland.c
- libweston/compositor-x11.c 2 additions, 2 deletionslibweston/compositor-x11.c
- libweston/compositor.c 7 additions, 5 deletionslibweston/compositor.c
- libweston/compositor.h 2 additions, 1 deletionlibweston/compositor.h
Loading
Please register or sign in to comment