summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-12-20 00:28:30 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-12-20 00:28:30 +0000
commit88907112c4e98d470b9ad174ae27b390e473f5a1 (patch)
tree7239b2bb777299ab953d7c9525ad38a260ee4afb
parent6162e7a92ff46fcd9247929a08ae9b7811966759 (diff)
merge XFree86 RC2 (4.3.99.902) from vendor branchXORG-RELEASE-1-BASEXEVIE-MERGEXEVIE-BASEXINERAMA_2XEVIE
-rw-r--r--src/mouse.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mouse.c b/src/mouse.c
index 0cbca6f..53924f1 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -1,4 +1,5 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.79 2003/11/03 05:11:48 tsi Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.80 2003/12/08 23:49:42 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.80 2003/12/08 23:49:42 dawes Exp $ */
/*
*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
@@ -1388,7 +1389,11 @@ MouseReadInput(InputInfoPtr pInfo)
(pBuf[0] & 0x80) >> 3; /* button 5 */
dx = (pBuf[0] & 0x10) ? pBuf[1]-256 : pBuf[1];
dy = (pBuf[0] & 0x20) ? -(pBuf[2]-256) : -pBuf[2];
- dz = (char)(pBuf[3] | ((pBuf[3] & 0x08) ? 0xf8 : 0));
+ /*
+ * The next cast must be 'signed char' for platforms (like PPC)
+ * where char defaults to unsigned.
+ */
+ dz = (signed char)(pBuf[3] | ((pBuf[3] & 0x08) ? 0xf8 : 0));
if ((pBuf[3] & 0xf8) && ((pBuf[3] & 0xf8) != 0xf8)) {
if (pMse->autoProbe) {
SetMouseProto(pMse, PROT_EXPPS2);
@@ -1498,6 +1503,10 @@ MouseReadInput(InputInfoPtr pInfo)
dy = - ((char)(pBuf[2]) + (char)(pBuf[4]));
/* FreeBSD sysmouse sends additional data bytes */
if (pMse->protoPara[4] >= 8) {
+ /*
+ * These casts must be 'signed char' for platforms (like PPC)
+ * where char defaults to unsigned.
+ */
dz = ((signed char)(pBuf[5] << 1) +
(signed char)(pBuf[6] << 1)) >> 1;
buttons |= (int)(~pBuf[7] & 0x7f) << 3;