From 9937183e4bd2e96154bb4724805f74341ae84bd6 Mon Sep 17 00:00:00 2001
From: Alexander Volkov <a.volkov@rusbitech.ru>
Date: Tue, 21 Apr 2020 12:38:03 +0300
Subject: [PATCH] Fix build with gcc 9.3.0's -Werror=alloc-size-larger-than=

---
 exa/exa_accel.c    | 2 +-
 hw/xnest/Display.c | 2 +-
 randr/rrcrtc.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 41fcb129f4..e632331da6 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -738,7 +738,7 @@ exaPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
         }
     }
 
-    prect = xallocarray(nseg, sizeof(xRectangle));
+    prect = xallocarray((unsigned int)nseg, sizeof(xRectangle));
     for (i = 0; i < nseg; i++) {
         if (pSeg[i].x1 < pSeg[i].x2) {
             prect[i].x = pSeg[i].x1;
diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c
index e6d07dfd12..dc59c6b91b 100644
--- a/hw/xnest/Display.c
+++ b/hw/xnest/Display.c
@@ -41,7 +41,7 @@ XVisualInfo *xnestVisuals;
 int xnestNumVisuals;
 int xnestDefaultVisualIndex;
 Colormap *xnestDefaultColormaps;
-static int xnestNumDefaultColormaps;
+static unsigned int xnestNumDefaultColormaps;
 int *xnestDepths;
 int xnestNumDepths;
 XPixmapFormatValues *xnestPixmapFormats;
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index ae7e306056..d870a9ab31 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1239,7 +1239,7 @@ ProcRRSetCrtcConfig(ClientPtr client)
     rrScrPrivPtr pScrPriv;
     RRCrtcPtr crtc;
     RRModePtr mode;
-    int numOutputs;
+    unsigned int numOutputs;
     RROutputPtr *outputs = NULL;
     RROutput *outputIds;
     TimeStamp time;
-- 
GitLab