summaryrefslogtreecommitdiff
path: root/src
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-18 14:40:07 +1000
commite0d651c77e3a59086d5f36d1aaf9e6ba80394336 (patch)
tree13374ce6178fb89b71ecaab874941a1d43eb2c81 /src
parentee265e10c9cc724ad0badcab86a3893667717322 (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>
Diffstat (limited to 'src')
-rw-r--r--src/eventcomm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index b7a47d8..d57f8e6 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -235,15 +235,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);
}