ports/78348: [PATCH] xorg-server/powerpc: mouse signed char issues

Peter Grehan grehan at FreeBSD.org
Thu Mar 3 09:20:19 UTC 2005


>Number:         78348
>Category:       ports
>Synopsis:       [PATCH] xorg-server/powerpc: mouse signed char issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 03 09:20:19 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Peter Grehan
>Release:        FreeBSD 6.0-CURRENT powerpc
>Organization:
>Environment:
FreeBSD emacfbsd.ptree32.com.au 6.0-CURRENT FreeBSD 6.0-CURRENT #75: Tue Mar  1 17:38:52 EST 2005     grehan@:/usr/obj/powerpc/home/grehan/freebsd/dev/src/sys/GENERIC  powerpc

xorg-server-6.8.1_2

>Description:
	When using sysmouse, the delta components require signed char arithmentic on powerpc. The comment for the code block just below implies this, but it's needed in the main case as well.

As an aside, NetBSD/PPC and Linux/PPC compile the entire server with -fsigned-chars. So far I haven't seen that this is necessary.
>How-To-Repeat:
	Watch the pointer move to the top right corner of the screen and stay there without this patch.
>Fix:

--- patch-mouse.c begins here ---
--- programs/Xserver/hw/xfree86/input/mouse/mouse.c.orig	Sat Jan 29 06:57:55 2005
+++ programs/Xserver/hw/xfree86/input/mouse/mouse.c	Sat Jan 29 06:59:03 2005
@@ -1501,8 +1501,8 @@
 
 	case PROT_SYSMOUSE:	/* sysmouse */
 	    buttons = (~pBuf[0]) & 0x07;
-	    dx =    (char)(pBuf[1]) + (char)(pBuf[3]);
-	    dy = - ((char)(pBuf[2]) + (char)(pBuf[4]));
+	    dx =    (signed char)(pBuf[1]) + (signed char)(pBuf[3]);
+	    dy = - ((signed char)(pBuf[2]) + (signed char)(pBuf[4]));
 	    /* FreeBSD sysmouse sends additional data bytes */
 	    if (pMse->protoPara[4] >= 8) {
 		/*
--- patch-mouse.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list