On 12 April 2018 at 14:48, Pekka Paalanen <ppaala...@gmail.com> wrote:
> On Thu, 12 Apr 2018 14:38:01 +0200 Daniel Stone <dan...@fooishbar.org> wrote:
>> > +               wl_list_for_each(head_base,
>> > +                                &b->compositor->head_list, 
>> > compositor_link) {
>>
>> wl_list_for_each(head, &b->compositor->head_list, base.compositor_link)
>>
>> You can get rid of the head_base declaration as well as the cast that way.
>
> Actually I very specifically chose to not do that. I want to keep the
> to_drm_head() call, because I envision in the future we will have
> several different kinds of heads (virtual maybe) and to_drm_head()
> might actually return NULL. Grepping for it will be easy, finding all
> the wl_list_for_each(..., base.derived_field) will be hard.
>
> I have been migrating the whole code base towards the explicit calls of
> down-cast wrappers and away from the sneaky container_of() double-casts
> as I go. This applies to outputs as well.

Oh, I hadn't at all thought about virtual / mixed-backend / etc
outputs. Good plan; objection dropped.

Cheers,
Daniel
_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to