[PATCH weston 2/3] ivi-shell: clear order.layer_list before reordering it

Bill Spitzak spitzak at gmail.com
Thu Aug 20 11:52:47 PDT 2015


On Thu, Aug 20, 2015 at 7:13 AM, Ucan, Emre (ADITG/SW1) <
eucan at de.adit-jv.com> wrote:

>
> Checking wl_list_empty() on a link offers no information: if it returns
> true, wl_list_remove() is safe to do. If it returns false, you still do not
> know if wl_list_remove() is safe;
> the link could be part of a list, or the link could be "uninitialized"
> (e.g. just wl_list_remove()'d). (From Pekka Paalanen's comment at
> http://lists.freedesktop.org/archives/wayland-devel/2015-August/023987.html
> ).
>

Correct me if I am wrong, but I think a more accurate statement is "if
wl_list_remove() is going to crash, then wl_list_empty() is also going to
crash. Therefore there is no reason to test wl_list_empty()". (by "crash" I
mean "use an uninitialized pointer" but that is the usual result).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150820/705a73fd/attachment.html>


More information about the wayland-devel mailing list