[vlc-commits] XCB/screen: width and height are unsigned

Rémi Denis-Courmont git at videolan.org
Wed Apr 23 19:27:17 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 23 20:26:58 2014 +0300| [23e14ee5bd1caaf2eb738a4abbdf8c2845de7282] | committer: Rémi Denis-Courmont

XCB/screen: width and height are unsigned

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=23e14ee5bd1caaf2eb738a4abbdf8c2845de7282
---

 modules/access/screen/xcb.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/access/screen/xcb.c b/modules/access/screen/xcb.c
index 3803ebe..bfdfacf 100644
--- a/modules/access/screen/xcb.c
+++ b/modules/access/screen/xcb.c
@@ -349,8 +349,8 @@ discard:
         return;
     }
 
-    int w = sys->w;
-    int h = sys->h;
+    unsigned w = sys->w;
+    unsigned h = sys->h;
     int x, y;
 
     if (sys->follow_mouse)
@@ -366,9 +366,9 @@ discard:
         if (w == 0 || w > geo->width)
             w = geo->width;
         x = ptr->win_x;
-        if (x < w / 2)
+        if (x < (int)(w / 2))
             x = 0;
-        else if (x >= (int)geo->width - (w / 2))
+        else if (x >= (int)(geo->width - (w / 2)))
             x = geo->width - w;
         else
             x -= w / 2;
@@ -376,9 +376,9 @@ discard:
         if (h == 0 || h > geo->height)
             h = geo->height;
         y = ptr->win_y;
-        if (y < h / 2)
+        if (y < (int)(h / 2))
             y = 0;
-        else if (y >= (int)geo->height - (h / 2))
+        else if (y >= (int)(geo->height - (h / 2)))
             y = geo->height - h;
         else
             y -= h / 2;
@@ -391,14 +391,14 @@ discard:
         max = (int)geo->width - x;
         if (max <= 0)
             goto discard;
-        if (w == 0 || w > max)
+        if (w == 0 || w > (unsigned)max)
             w = max;
 
         y = sys->y;
         max = (int)geo->height - y;
         if (max <= 0)
             goto discard;
-        if (h == 0 || h > max)
+        if (h == 0 || h > (unsigned)max)
             h = max;
     }
 



More information about the vlc-commits mailing list