--- programs/Xserver/hw/tinyx/linux/mouse.c.old Thu Nov 2 21:51:21 2006
+++ programs/Xserver/hw/tinyx/linux/mouse.c Thu Jun 11 03:55:09 2009
@@ -1,5 +1,5 @@
/*
- * $XFree86: xc/programs/Xserver/hw/tinyx/linux/mouse.c,v 1.3 2006/11/02 21:55:26 tsi Exp $
+ * $RCSId: xc/programs/Xserver/hw/kdrive/linux/mouse.c,v 1.6 2002/08/02 16:11:35 keithp Exp $
*
* Copyright � 2001 Keith Packard, member of The XFree86 Project, Inc.
*
@@ -68,19 +68,23 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
static Bool
MouseWaitForWritable (int fd, int timeout)
@@ -263,8 +284,7 @@
unsigned long state; /* private per protocol, init to prot->state */
} Kmouse;
-static int
-mouseValid (KdMouseInfo *mi, unsigned char *ev, int ne)
+static int mouseValid (KdMouseInfo *mi, unsigned char *ev, int ne)
{
Kmouse *km = mi->driver;
const KmouseProt *prot = km->prot;
@@ -281,26 +301,22 @@
return 0;
}
-static Bool
-threeComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool threeComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
{
return ne == 3;
}
-static Bool
-fourComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool fourComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
{
return ne == 4;
}
-static Bool
-fiveComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool fiveComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
{
return ne == 5;
}
-static Bool
-MouseReasonable (KdMouseInfo *mi, unsigned long flags, int dx, int dy)
+static Bool MouseReasonable (KdMouseInfo *mi, unsigned long flags, int dx, int dy)
{
Kmouse *km = mi->driver;
@@ -326,12 +342,12 @@
/*
* Standard PS/2 mouse protocol
*/
-static Bool
-ps2Parse (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool ps2Parse (KdMouseInfo *mi, unsigned char *ev, int ne)
{
Kmouse *km = mi->driver;
int dx, dy, dz;
unsigned long flags;
+ unsigned long flagsrelease = 0;
@@ -470,7 +499,7 @@
ps2SkipInit (KdMouseInfo *mi, int ninit, Bool ret_next)
{
Kmouse *km = mi->driver;
- int c = 0;
+ int c = -1;
int skipping;
Bool waiting;
@@ -478,7 +507,7 @@
waiting = FALSE;
while (ninit || ret_next)
{
- c = MouseReadByte (&km->iob, 100);
+ c = MouseReadByte (&km->iob, MOUSE_TIMEOUT);
if (c == -1)
break;
/* look for ACK */
@@ -508,7 +537,7 @@
int ninit;
/* Send Intellimouse initialization sequence */
- MouseWriteBytes (km->iob.fd, intelli_init, strlen ((char *)intelli_init), 100);
+ MouseWriteBytes (km->iob.fd, intelli_init, strlen (intelli_init), 100);
/*
* Send ID command
*/
@@ -535,7 +564,7 @@
break;
}
if (init)
- MouseWriteBytes (km->iob.fd, init, strlen ((char *)init), 100);
+ MouseWriteBytes (km->iob.fd, init, strlen (init), 100);
/*
* Flush out the available data to eliminate responses to the
* initialization string. Make sure any partial event is
@@ -545,8 +574,7 @@
return TRUE;
}
-static Bool
-busParse (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool busParse (KdMouseInfo *mi, unsigned char *ev, int ne)
{
Kmouse *km = mi->driver;
int dx, dy;
@@ -579,8 +607,7 @@
* Standard MS serial protocol, three bytes
*/
-static Bool
-msParse (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool msParse (KdMouseInfo *mi, unsigned char *ev, int ne)
{
Kmouse *km = mi->driver;
int dx, dy;
@@ -619,8 +646,7 @@
* first byte of a synchronized protocol stream and see if it's got
* any bits turned on that can't occur in that fourth byte
*/
-static Bool
-logiComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
+static Bool logiComplete (KdMouseInfo *mi, unsigned char *ev, int ne)
{
Kmouse *km = mi->driver;
@@ -631,8 +657,7 @@
return FALSE;
}
-static int
-logiValid (KdMouseInfo *mi, unsigned char *ev, int ne)
+static int logiValid (KdMouseInfo *mi, unsigned char *ev, int ne)
{
Kmouse *km = mi->driver;
const KmouseProt *prot = km->prot;
@@ -653,8 +678,7 @@
return 0;
}