diff options
author | Peter Osterlund <petero2@telia.com> | 2003-07-29 02:11:22 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:01:04 +0200 |
commit | fb54b61a1a4beede088e57b92c9277c23cfde350 (patch) | |
tree | 35898dbbb60faee871bc3ee05d63028da121c7ff | |
parent | d5785a9652c6d832f97b1b054f4e436f9b61c0eb (diff) |
Minor cleanup.
-rw-r--r-- | synaptics.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/synaptics.c b/synaptics.c index 7c4f3a9..3afbe80 100644 --- a/synaptics.c +++ b/synaptics.c @@ -1429,7 +1429,7 @@ SynapticsParseRawPacket(LocalDevicePtr local, SynapticsPrivatePtr priv, ((buf[3] & 0x04) >> 2)); hw->left = (buf[0] & 0x01) ? 1 : 0; - hw->right = (buf[0] & 0x2) ? 1 : 0; + hw->right = (buf[0] & 0x02) ? 1 : 0; hw->up = 0; hw->down = 0; @@ -1444,13 +1444,13 @@ SynapticsParseRawPacket(LocalDevicePtr local, SynapticsPrivatePtr priv, } if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)) { /* aka. type with 6 buttons */ - if (priv->protoBuf[3] == 0xC2) { + if (buf[3] == 0xC2) { if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) > 2) { - hw->cbLeft = (priv->protoBuf[4] & 0x02) ? TRUE : FALSE; - hw->cbRight = (priv->protoBuf[5] & 0x02) ? TRUE : FALSE; + hw->cbLeft = (buf[4] & 0x02) ? TRUE : FALSE; + hw->cbRight = (buf[5] & 0x02) ? TRUE : FALSE; } - hw->up = (priv->protoBuf[4] & 0x01) ? TRUE : FALSE; - hw->down = (priv->protoBuf[5] & 0x01) ? TRUE : FALSE; + hw->up = (buf[4] & 0x01) ? TRUE : FALSE; + hw->down = (buf[5] & 0x01) ? TRUE : FALSE; } else { hw->cbLeft = hw->cbRight = hw->up = hw->down = FALSE; } @@ -1487,9 +1487,7 @@ SynapticsGetPacket(LocalDevicePtr local, SynapticsPrivatePtr priv) { int count = 0; int c; - unsigned char *pBuf, u; - - pBuf = priv->protoBuf; + unsigned char u; while((c = XisbRead(priv->buffer)) >= 0) { u = (unsigned char)c; @@ -1522,7 +1520,7 @@ SynapticsGetPacket(LocalDevicePtr local, SynapticsPrivatePtr priv) return (!Success); } - pBuf[priv->protoBufTail++] = u; + priv->protoBuf[priv->protoBufTail++] = u; /* check first byte */ if((priv->protoBufTail == 1) && ((u & 0xC8) != 0x80)) |