util: fix container_of() macro
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 10 May 2017 02:33:10 +0000 (12:33 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 10 May 2017 02:33:10 +0000 (12:33 +1000)
commit3925936969e993709c832731343ace3ff5e695d0
tree0f082d6f00b0b2eec14d0656b5eeb79f25dd558b
parent89490d2b344c671721744d7cd4c3a98d14fcfee3
util: fix container_of() macro

Fixes a bunch of warnings of the kind
../src/evdev.h:378:32: warning: variable 'f' is uninitialized when used here [-Wuninitialized]
        return container_of(dispatch, f, base);

Just typecasting NULL means we can ignore sample but for the type.

https://bugs.freedesktop.org/show_bug.cgi?id=100976

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Tested-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/libinput-util.h