dlls/winex11.drv/mouse.c simplification

Gerald Pfeifer gerald at pfeifer.com
Sat Dec 29 16:55:58 CST 2007


xhot and yhot are of type XcursorDim which in turn is typedef-ed to
XcursorUInt, so the two checks I'm removing are noops.

Gerald

ChangeLog:
Simplify condition in create_xcursor_cursor() based on the unsignedness
of types.

Index: dlls/winex11.drv/mouse.c
===================================================================
RCS file: /home/wine/wine/dlls/winex11.drv/mouse.c,v
retrieving revision 1.23
diff -u -3 -p -r1.23 mouse.c
--- dlls/winex11.drv/mouse.c	14 Dec 2007 13:41:22 -0000	1.23
+++ dlls/winex11.drv/mouse.c	29 Dec 2007 19:52:55 -0000
@@ -566,8 +566,8 @@ static Cursor create_xcursor_cursor( Dis
     /* Make sure hotspot is valid */
     image->xhot = ptr->ptHotSpot.x;
     image->yhot = ptr->ptHotSpot.y;
-    if (image->xhot < 0 || image->xhot >= image->width ||
-        image->yhot < 0 || image->yhot >= image->height)
+    if (image->xhot >= image->width ||
+        image->yhot >= image->height)
     {
         image->xhot = image->width / 2;
         image->yhot = image->height / 2;



More information about the wine-patches mailing list