[PATCH weston 3/3] xwm: Test hash_table_lookup() returns

Derek Foreman derekf at osg.samsung.com
Tue Apr 7 11:48:59 PDT 2015


Thanks for taking a look!

On 07/04/15 01:34 PM, Bill Spitzak wrote:
> Oh ok I see you put this in a different patch. I think the patches
> should be merged since you have to change all the calls in the first
> patch anyway.

The 3rd patch fixes bugs, the 2nd is more cosmetic.  I thought they'd be
easier to review independently and result in a clearer git history.

> I don't like the temporary variable, it seems like you can just put the
> call to hash_table_lookup in the if statement and it will be clearer.

I dunno, the if statement pretty much always exceeds 80 cols and I have
to break it into a couple of lines and it starts to look pretty crappy.

> On 04/07/2015 10:12 AM, Derek Foreman wrote:
> 
>> +    int found;
>>
>> -    hash_table_lookup(wm->window_hash, leave->event, &window);
>> -    if (!window || !window->decorate)
>> +    found = hash_table_lookup(wm->window_hash, leave->event, &window);
>> +    if (!found || !window->decorate)
>>           return;
> 
> ie:
> 
>     if (!hash_table_lookup(wm->window_hash, leave->event, &window))
>       return;
>     if (!window->decorate)
>       return;
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list