summaryrefslogtreecommitdiffstats
path: root/sys/dev/joy
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-05-06 18:39:32 +0000
committerpeter <peter@FreeBSD.org>1999-05-06 18:39:32 +0000
commitdaa969b0667e983bbabc44c8ddcda321b70523c5 (patch)
tree82f0ee7becf00c3670d742c63db674ed9f2bee09 /sys/dev/joy
parent6823e815bb122c9f00c61226c6be6cd590c34c34 (diff)
downloadFreeBSD-src-daa969b0667e983bbabc44c8ddcda321b70523c5.zip
FreeBSD-src-daa969b0667e983bbabc44c8ddcda321b70523c5.tar.gz
The joypart() macro had a precedence bug. Add seatbelts for UNIT() too.
Diffstat (limited to 'sys/dev/joy')
-rw-r--r--sys/dev/joy/joy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c
index 2561cd2..5d4a7c2 100644
--- a/sys/dev/joy/joy.c
+++ b/sys/dev/joy/joy.c
@@ -65,8 +65,8 @@
#define ticks2usec(u) (((u) * 3433)>>12)
-#define joypart(d) minor(d)&1
-#define UNIT(d) minor(d)>>1&3
+#define joypart(d) (minor(d)&1)
+#define UNIT(d) ((minor(d)>>1)&3)
#ifndef JOY_TIMEOUT
#define JOY_TIMEOUT 2000 /* 2 milliseconds */
#endif
OpenPOWER on IntegriCloud