tablet: split a ternary condition into a normal if else for readability
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 10 Sep 2020 22:42:15 +0000 (08:42 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 22 Sep 2020 07:35:41 +0000 (17:35 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-tablet.c

index 58ae0a00776222df4ab7e9b940b0c5bb7f28f845..d4e3890a0129dc69c2db774793859da9bfdde2a5 100644 (file)
@@ -1194,8 +1194,10 @@ tablet_notify_button_mask(struct tablet_dispatch *tablet,
        size_t nbits = 8 * sizeof(buttons->bits);
        enum libinput_tablet_tool_tip_state tip_state;
 
-       tip_state = tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT) ?
-                       LIBINPUT_TABLET_TOOL_TIP_DOWN : LIBINPUT_TABLET_TOOL_TIP_UP;
+       if (tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT))
+               tip_state = LIBINPUT_TABLET_TOOL_TIP_DOWN;
+       else
+               tip_state = LIBINPUT_TABLET_TOOL_TIP_UP;
 
        for (i = 0; i < nbits; i++) {
                if (!bit_is_set(buttons->bits, i))