Commit 23e14ee5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB/screen: width and height are unsigned

parent 1e42c432
...@@ -349,8 +349,8 @@ discard: ...@@ -349,8 +349,8 @@ discard:
return; return;
} }
int w = sys->w; unsigned w = sys->w;
int h = sys->h; unsigned h = sys->h;
int x, y; int x, y;
if (sys->follow_mouse) if (sys->follow_mouse)
...@@ -366,9 +366,9 @@ discard: ...@@ -366,9 +366,9 @@ discard:
if (w == 0 || w > geo->width) if (w == 0 || w > geo->width)
w = geo->width; w = geo->width;
x = ptr->win_x; x = ptr->win_x;
if (x < w / 2) if (x < (int)(w / 2))
x = 0; x = 0;
else if (x >= (int)geo->width - (w / 2)) else if (x >= (int)(geo->width - (w / 2)))
x = geo->width - w; x = geo->width - w;
else else
x -= w / 2; x -= w / 2;
...@@ -376,9 +376,9 @@ discard: ...@@ -376,9 +376,9 @@ discard:
if (h == 0 || h > geo->height) if (h == 0 || h > geo->height)
h = geo->height; h = geo->height;
y = ptr->win_y; y = ptr->win_y;
if (y < h / 2) if (y < (int)(h / 2))
y = 0; y = 0;
else if (y >= (int)geo->height - (h / 2)) else if (y >= (int)(geo->height - (h / 2)))
y = geo->height - h; y = geo->height - h;
else else
y -= h / 2; y -= h / 2;
...@@ -391,14 +391,14 @@ discard: ...@@ -391,14 +391,14 @@ discard:
max = (int)geo->width - x; max = (int)geo->width - x;
if (max <= 0) if (max <= 0)
goto discard; goto discard;
if (w == 0 || w > max) if (w == 0 || w > (unsigned)max)
w = max; w = max;
y = sys->y; y = sys->y;
max = (int)geo->height - y; max = (int)geo->height - y;
if (max <= 0) if (max <= 0)
goto discard; goto discard;
if (h == 0 || h > max) if (h == 0 || h > (unsigned)max)
h = max; h = max;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment