Fixed sign-compare warnings
authorArmin Novak <armin.novak@thincast.com>
Thu, 7 Feb 2019 13:20:24 +0000 (14:20 +0100)
committerArmin Novak <armin.novak@thincast.com>
Fri, 5 Apr 2019 07:13:24 +0000 (09:13 +0200)
server/shadow/X11/x11_shadow.c
server/shadow/shadow_client.c

index 7245432..22c043a 100644 (file)
@@ -557,7 +557,7 @@ static int x11_shadow_query_cursor(x11ShadowSubsystem* subsystem, BOOL getImage)
                y -= surface->y;
        }
 
-       if ((x != subsystem->common.pointerX) || (y != subsystem->common.pointerY))
+       if ((x != (INT64)subsystem->common.pointerX) || (y != (INT64)subsystem->common.pointerY))
        {
                subsystem->common.pointerX = x;
                subsystem->common.pointerY = y;
@@ -719,7 +719,7 @@ static BOOL x11_shadow_check_resize(x11ShadowSubsystem* subsystem)
        XGetWindowAttributes(subsystem->display, subsystem->root_window, &attr);
        XUnlockDisplay(subsystem->display);
 
-       if (attr.width != subsystem->width || attr.height != subsystem->height)
+       if (attr.width != (INT64)subsystem->width || attr.height != (INT64)subsystem->height)
        {
                /* Screen size changed. Refresh monitor definitions and trigger screen resize */
                subsystem->common.numMonitors = x11_shadow_enum_monitors(subsystem->common.monitors, 16);
@@ -1176,8 +1176,8 @@ UINT32 x11_shadow_enum_monitors(MONITOR_DEF* monitors, UINT32 maxMonitors)
                {
                        screens = XineramaQueryScreens(display, &numMonitors);
 
-                       if (numMonitors > maxMonitors)
-                               numMonitors = maxMonitors;
+                       if (numMonitors > (INT64)maxMonitors)
+                               numMonitors = (int)maxMonitors;
 
                        if (screens && (numMonitors > 0))
                        {
@@ -1270,7 +1270,7 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub)
        {
                pf = pfs + i;
 
-               if (pf->depth == subsystem->depth)
+               if (pf->depth == (INT64)subsystem->depth)
                {
                        subsystem->bpp = pf->bits_per_pixel;
                        subsystem->scanline_pad = pf->scanline_pad;
@@ -1295,7 +1295,7 @@ static int x11_shadow_subsystem_init(rdpShadowSubsystem* sub)
        {
                vi = vis + i;
 
-               if (vi->depth == subsystem->depth)
+               if (vi->depth == (INT64)subsystem->depth)
                {
                        subsystem->visual = vi->visual;
                        break;
index 149be18..22e39e2 100644 (file)
@@ -395,7 +395,7 @@ static INLINE void shadow_client_convert_rects(rdpShadowClient* client,
 {
        if (client->server->shareSubRect)
        {
-               int i = 0;
+               UINT32 i = 0;
                UINT16 offsetX = client->server->subRect.left;
                UINT16 offsetY = client->server->subRect.top;
 
@@ -1138,7 +1138,8 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client,
        BOOL ret = TRUE;
        BYTE* data;
        BYTE* buffer;
-       int yIdx, xIdx, k;
+       size_t k;
+       int yIdx, xIdx;
        int rows, cols;
        UINT32 DstSize;
        UINT32 SrcFormat;
@@ -1227,11 +1228,11 @@ static BOOL shadow_client_send_bitmap_update(rdpShadowClient* client,
                        bitmap->destLeft = nXSrc + (xIdx * 64);
                        bitmap->destTop = nYSrc + (yIdx * 64);
 
-                       if ((bitmap->destLeft + bitmap->width) > (nXSrc + nWidth))
-                               bitmap->width = (nXSrc + nWidth) - bitmap->destLeft;
+                       if ((INT64)(bitmap->destLeft + bitmap->width) > (nXSrc + nWidth))
+                               bitmap->width = (UINT32)(nXSrc + nWidth) - bitmap->destLeft;
 
-                       if ((bitmap->destTop + bitmap->height) > (nYSrc + nHeight))
-                               bitmap->height = (nYSrc + nHeight) - bitmap->destTop;
+                       if ((INT64)(bitmap->destTop + bitmap->height) > (nYSrc + nHeight))
+                               bitmap->height = (UINT32)(nYSrc + nHeight) - bitmap->destTop;
 
                        bitmap->destRight = bitmap->destLeft + bitmap->width - 1;
                        bitmap->destBottom = bitmap->destTop + bitmap->height - 1;