[PATCH weston 05/21] libweston: weston_output_init(..., +name)

Ray, Ian (GE Healthcare) ian.ray at ge.com
Mon Sep 25 06:08:39 UTC 2017


On 22/09/2017, 17.32, "wayland-devel on behalf of Pekka Paalanen" <wayland-devel-bounces at lists.freedesktop.org on behalf of ppaalanen at gmail.com> wrote:
> 
> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> 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 at collabora.co.uk>

Reviewed-by: Ian Ray <ian.ray at ge.com>




More information about the wayland-devel mailing list