From e38bf6dd98764bc77ab792f7ca5c3657fbeb1faf Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 21 Sep 2007 09:01:21 +0000 Subject: [PATCH] fix a signed/unsigned comparison warning --- libs/video/targets/in_x11.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index 1377fc92a..75954d02e 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -552,10 +552,11 @@ event_motion (XEvent *event) } else { if (vid_fullscreen->int_val || in_grab->int_val) { if (!event->xmotion.send_event) { + unsigned dist_x = abs (vid.width / 2 - event->xmotion.x); + unsigned dist_y = abs (vid.height / 2 - event->xmotion.y); in_mouse_x += (event->xmotion.x - p_mouse_x); in_mouse_y += (event->xmotion.y - p_mouse_y); - if (abs (vid.width / 2 - event->xmotion.x) > vid.width / 4 || - abs (vid.height / 2 - event->xmotion.y) > vid.height / 4) { + if (dist_x > vid.width / 4 || dist_y > vid.height / 4) { center_pointer (); } }