xf86-input-mouse signed/unsigned issue with Microsoft protocol

Wichmann, Mats D mats.d.wichmann at intel.com
Fri Aug 28 07:28:02 PDT 2009

From: xorg-bounces at lists.freedesktop.org [mailto:xorg-bounces at lists.freedesktop.org] On Behalf Of Donald Kayser
Sent: Friday, August 28, 2009 8:17 AM
To: xorg at lists.freedesktop.org
Subject: xf86-input-mouse signed/unsigned issue with Microsoft protocol

I am developing under a PPC embedded system running Linux, xserver from debian distribution of 7.3+19, xf86-input-mouse 1.3.0. I have a custom board that I am sending Microsoft mouse 3 byte protocol through a pipe to the input of xserver via the mouse driver. I was able to make small movements, all positive, but if I moved negative, the mouse would jump a large amount in the positive direction. I checked out from git and built the mouse driver and turned on debug to find out and it is not accepting negative numbers correctly in the case of PROT_MS. By changing the cast on lines 1304/1305 in mouse.c from (char) to (signed char), I fixed the problem. I don't know if this exists on other (non PPC) platforms.  I also noticed the potential for the same problem in a few more places. I am using gcc-4.3.

Chars are unsigned on ppc and, I believe s390.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20090828/71b2e208/attachment.html>

More information about the xorg mailing list