summaryrefslogtreecommitdiff
path: root/src/eventcomm.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-15 11:59:58 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-19 08:42:00 +1000
commit4b12887fbd4ae82196b4e64beef0118905c5aa38 (patch)
treecd703aabba59c56844c4b712892fdf7a526343ac /src/eventcomm.c
parent372ab4c9b66e3d267e35275d3d2597cdb594ed73 (diff)
eventcomm: force boolean values for has_left, has_right, etc.
TEST_BIT simply returns the value of the bytes, so we end up with has_left and friends being an integer value instead of a boolean value. This again may cause confusion in other parts, if a 1/0 boolean value is expected (e.g. all xf86SetBoolOption()). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se> (cherry picked from commit e0d651c77e3a59086d5f36d1aaf9e6ba80394336)
Diffstat (limited to 'src/eventcomm.c')
-rw-r--r--src/eventcomm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 5b38c28..690d179 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -202,15 +202,15 @@ event_query_axis_ranges(LocalDevicePtr local)
if (rc >= 0)
{
buf[0] = 0;
- if ((priv->has_left = TEST_BIT(BTN_LEFT, keybits)))
+ if ((priv->has_left = (TEST_BIT(BTN_LEFT, keybits) != 0)))
strcat(buf, " left");
- if ((priv->has_right = TEST_BIT(BTN_RIGHT, keybits)))
+ if ((priv->has_right = (TEST_BIT(BTN_RIGHT, keybits) != 0)))
strcat(buf, " right");
- if ((priv->has_middle = TEST_BIT(BTN_MIDDLE, keybits)))
+ if ((priv->has_middle = (TEST_BIT(BTN_MIDDLE, keybits) != 0)))
strcat(buf, " middle");
- if ((priv->has_double = TEST_BIT(BTN_TOOL_DOUBLETAP, keybits)))
+ if ((priv->has_double = (TEST_BIT(BTN_TOOL_DOUBLETAP, keybits) != 0)))
strcat(buf, " double");
- if ((priv->has_triple = TEST_BIT(BTN_TOOL_TRIPLETAP, keybits)))
+ if ((priv->has_triple = (TEST_BIT(BTN_TOOL_TRIPLETAP, keybits) != 0)))
strcat(buf, " triple");
xf86Msg(X_INFO, "%s: buttons:%s\n", local->name, buf);
}