From 7185a8a484de41c878149e23848c903893936e14 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 13 Sep 2022 16:28:37 -0700 Subject: Handle -Wsign-compare warnings Signed-off-by: Alan Coopersmith --- src/AllCmap.c | 2 +- src/CursorName.c | 2 +- src/StdCmap.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AllCmap.c b/src/AllCmap.c index a974ce0..07edf38 100644 --- a/src/AllCmap.c +++ b/src/AllCmap.c @@ -110,7 +110,7 @@ XmuAllStandardColormaps(Display *dpy) v2 = getDeepestVisual(PseudoColor, vinfo, nvisuals); if (v2 && - (!v1 || (v2->colormap_size >= + (!v1 || (v2->colormap_size >= (long) ((v1->red_mask | v1->green_mask | v1->blue_mask) + 1)))) status = XmuVisualStandardColormaps(dpy, scr, v2->visualid, (unsigned) v2->depth, 1, 1); diff --git a/src/CursorName.c b/src/CursorName.c index 635ae51..82bc5fa 100644 --- a/src/CursorName.c +++ b/src/CursorName.c @@ -119,7 +119,7 @@ XmuCursorNameToIndex(_Xconst char *name) }; #define NUM_CURSOR_NAMES (sizeof (cursor_names) / sizeof (cursor_names[0])) register _Xconst struct _CursorName *table; - register int i; + unsigned int i; char tmp[40]; if (strlen (name) >= sizeof tmp) return -1; diff --git a/src/StdCmap.c b/src/StdCmap.c index ccc822e..4da007b 100644 --- a/src/StdCmap.c +++ b/src/StdCmap.c @@ -190,11 +190,11 @@ valid_args(XVisualInfo *vinfo, unsigned long red_max, unsigned long green_max, return 0; } else if (property == XA_RGB_GRAY_MAP) { ncolors = red_max + green_max + blue_max + 1; - if (ncolors > vinfo->colormap_size) + if (ncolors > (unsigned long) vinfo->colormap_size) return 0; } else { ncolors = (red_max + 1) * (green_max + 1) * (blue_max + 1); - if (ncolors > vinfo->colormap_size) + if (ncolors > (unsigned long) vinfo->colormap_size) return 0; } -- cgit v1.2.1