Enumerate libevdev_next_event() return codes
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 11 Sep 2013 00:32:36 +0000 (10:32 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 11 Sep 2013 02:10:12 +0000 (12:10 +1000)
commit5d2fc78138d132e6749665fe0cf34d6454375e6f
tree9c7f694662e1d592c385ae90394710494c6ed901
parent7421760eae467b9cabdbdaaa34a2e9271cee5bcf
Enumerate libevdev_next_event() return codes

Improved readability in callers, changing magic numbers 0 and 1 to

rc = libevdev_next_event();
if (rc == LIBEVDEV_READ_STATUS_SUCCESS)
    do_something();
else if (rc == LIBEVDEV_READ_STATUS_SYNC)
    do_something_else()

No ABI changes, the enum values are the previously documented values,
this is just a readability improvement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
libevdev/libevdev.c
libevdev/libevdev.h
test/test-libevdev-events.c
tools/libevdev-events.c