Module Name:    xsrc
Committed By:   mrg
Date:           Sat Oct 29 21:02:04 UTC 2022

Modified Files:
        xsrc/external/mit/libXext/dist/src: XEVI.c XSync.c Xge.c extutil.c
        xsrc/external/mit/libXmu/dist/src: CmapAlloc.c
        xsrc/external/mit/libXrender/dist/src: Filter.c Xrender.c
        xsrc/external/mit/libxkbfile/dist/src: cout.c
        xsrc/external/mit/libxshmfence/dist/src: xshmfence_alloc.c
Removed Files:
        xsrc/external/mit/libXpresent/dist: README
        xsrc/external/mit/libXrender/dist: README
        xsrc/external/mit/libxshmfence/dist: README

Log Message:
merge libXext 1.3.5, libbXmu 1.1.4, libXrender 1.0.1, libxkbfile 1.1.1 and
libxshmfence 1.3.1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXext/dist/src/XEVI.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXext/dist/src/XSync.c
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libXext/dist/src/Xge.c \
    xsrc/external/mit/libXext/dist/src/extutil.c
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/libXmu/dist/src/CmapAlloc.c
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/libXpresent/dist/README
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/libXrender/dist/README
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXrender/dist/src/Filter.c \
    xsrc/external/mit/libXrender/dist/src/Xrender.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libxkbfile/dist/src/cout.c
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/libxshmfence/dist/README
cvs rdiff -u -r1.2 -r1.3 \
    xsrc/external/mit/libxshmfence/dist/src/xshmfence_alloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/libXext/dist/src/XEVI.c
diff -u xsrc/external/mit/libXext/dist/src/XEVI.c:1.2 xsrc/external/mit/libXext/dist/src/XEVI.c:1.3
--- xsrc/external/mit/libXext/dist/src/XEVI.c:1.2	Mon Sep  7 15:20:53 2020
+++ xsrc/external/mit/libXext/dist/src/XEVI.c	Sat Oct 29 21:02:03 2022
@@ -31,6 +31,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include <X11/extensions/extutil.h>
 #include <X11/Xutil.h>
 #include <limits.h>
+#include "reallocarray.h"
 
 static XExtensionInfo *xevi_info;/* needs to move to globals.c */
 static const char *xevi_extension_name = EVINAME;
@@ -126,7 +127,7 @@ Status XeviGetVisualInfo(
 	return BadValue;
     }
     if (!n_visual || !visual) {		/* copy the all visual */
-    	temp_visual = (VisualID32 *)Xmalloc(sz_VisualID32 * sz_info);
+	temp_visual = Xcalloc(sz_info, sz_VisualID32);
     	n_visual = 0;
         for (vinfoIndex = 0; vinfoIndex < sz_info; vinfoIndex++)
 	    if (notInList(temp_visual, n_visual, vinfo[vinfoIndex].visualid))
@@ -148,7 +149,7 @@ Status XeviGetVisualInfo(
 	        return BadValue;
 	    }
 	}
-	temp_visual = (VisualID32 *)Xmalloc(sz_VisualID32 * n_visual);
+	temp_visual = Xmallocarray(n_visual, sz_VisualID32);
         for (visualIndex = 0; visualIndex < n_visual; visualIndex++)
 	    temp_visual[visualIndex] = visual[visualIndex];
     }
@@ -172,7 +173,7 @@ Status XeviGetVisualInfo(
 	sz_xInfo = rep.n_info * sz_xExtendedVisualInfo;
 	sz_conflict = rep.n_conflicts * sizeof(VisualID);
 	sz_xConflict = rep.n_conflicts * sz_VisualID32;
-	*evi_return = Xmalloc(sz_info + sz_conflict);
+	*evi_return = Xcalloc(sz_info + sz_conflict, 1);
 	temp_xInfo = Xmalloc(sz_xInfo);
 	temp_conflict = Xmalloc(sz_xConflict);
     } else {

Index: xsrc/external/mit/libXext/dist/src/XSync.c
diff -u xsrc/external/mit/libXext/dist/src/XSync.c:1.4 xsrc/external/mit/libXext/dist/src/XSync.c:1.5
--- xsrc/external/mit/libXext/dist/src/XSync.c:1.4	Wed Jul 22 02:23:01 2015
+++ xsrc/external/mit/libXext/dist/src/XSync.c	Sat Oct 29 21:02:03 2022
@@ -358,7 +358,7 @@ XSyncListSystemCounters(Display *dpy, in
 	int i;
 
 	if (rep.nCounters < (INT_MAX / sizeof(XSyncSystemCounter)))
-	    list = Xmalloc(rep.nCounters * sizeof(XSyncSystemCounter));
+	    list = Xcalloc(rep.nCounters, sizeof(XSyncSystemCounter));
 	if (rep.length < (INT_MAX >> 2)) {
 	    replylen = rep.length << 2;
 	    pWireSysCounter = Xmalloc (replylen + sizeof(XSyncCounter));

Index: xsrc/external/mit/libXext/dist/src/Xge.c
diff -u xsrc/external/mit/libXext/dist/src/Xge.c:1.6 xsrc/external/mit/libXext/dist/src/Xge.c:1.7
--- xsrc/external/mit/libXext/dist/src/Xge.c:1.6	Wed Jul 22 02:23:01 2015
+++ xsrc/external/mit/libXext/dist/src/Xge.c	Sat Oct 29 21:02:03 2022
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2007-2008 Peter Hutterer
+ * Copyright © 2007-2008 Peter Hutterer
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -39,6 +39,8 @@
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/Xge.h>
 
+#include "extutilP.h"
+
 /***********************************************************************/
 /*                    internal data structures                         */
 /***********************************************************************/
@@ -141,7 +143,7 @@ _xgeCheckExtInit(Display* dpy, XExtDispl
 
     if (!info->data)
     {
-        XGEData* data = (XGEData*)Xmalloc(sizeof(XGEData));
+        XGEData* data = Xmalloc(sizeof(XGEData));
         if (!data) {
             goto cleanup;
         }
@@ -190,7 +192,7 @@ _xgeGetExtensionVersion(Display* dpy,
         return NULL;
     }
 
-    vers = (XGEVersionRec*)Xmalloc(sizeof(XGEVersionRec));
+    vers = Xmalloc(sizeof(XGEVersionRec));
     vers->major_version = rep.majorVersion;
     vers->minor_version = rep.minorVersion;
     return vers;
@@ -313,7 +315,7 @@ _X_HIDDEN xgeExtRegister(Display* dpy, i
 
     xge_data = (XGEData*)info->data;
 
-    newExt = (XGEExtNode*)Xmalloc(sizeof(XGEExtNode));
+    newExt = Xmalloc(sizeof(XGEExtNode));
     if (!newExt)
     {
         fprintf(stderr, "xgeExtRegister: Failed to alloc memory.\n");
Index: xsrc/external/mit/libXext/dist/src/extutil.c
diff -u xsrc/external/mit/libXext/dist/src/extutil.c:1.6 xsrc/external/mit/libXext/dist/src/extutil.c:1.7
--- xsrc/external/mit/libXext/dist/src/extutil.c:1.6	Sat Jun  1 07:45:50 2013
+++ xsrc/external/mit/libXext/dist/src/extutil.c	Sat Oct 29 21:02:03 2022
@@ -54,9 +54,7 @@ in this Software without prior written a
 #include <X11/extensions/extutil.h>
 #include <X11/extensions/ge.h>
 
-/* defined in Xge.c */
-extern _X_HIDDEN Bool
-xgeExtRegister(Display* dpy, int extension, XExtensionHooks* callbacks);
+#include "extutilP.h"
 
 /*
  * XextCreateExtension - return an extension descriptor containing context
@@ -65,8 +63,7 @@ xgeExtRegister(Display* dpy, int extensi
  */
 XExtensionInfo *XextCreateExtension (void)
 {
-    register XExtensionInfo *info =
-      (XExtensionInfo *) Xmalloc (sizeof (XExtensionInfo));
+    register XExtensionInfo *info = Xmalloc (sizeof (XExtensionInfo));
 
     if (info) {
 	info->head = NULL;
@@ -85,7 +82,7 @@ void XextDestroyExtension (XExtensionInf
     info->head = NULL;			/* to catch refs after this */
     info->cur = NULL;
     info->ndisplays = 0;
-    XFree ((char *) info);
+    XFree (info);
 }
 
 
@@ -103,7 +100,7 @@ XExtDisplayInfo *XextAddDisplay (
 {
     XExtDisplayInfo *dpyinfo;
 
-    dpyinfo = (XExtDisplayInfo *) Xmalloc (sizeof (XExtDisplayInfo));
+    dpyinfo = Xmalloc (sizeof (XExtDisplayInfo));
     if (!dpyinfo) return NULL;
     dpyinfo->display = dpy;
     dpyinfo->data = data;
@@ -205,7 +202,7 @@ int XextRemoveDisplay (XExtensionInfo *e
     if (dpyinfo == extinfo->cur) extinfo->cur = NULL;  /* flush cache */
     _XUnlockMutex(_Xglobal_lock);
 
-    Xfree ((char *) dpyinfo);
+    Xfree (dpyinfo);
     return 1;
 }
 

Index: xsrc/external/mit/libXmu/dist/src/CmapAlloc.c
diff -u xsrc/external/mit/libXmu/dist/src/CmapAlloc.c:1.5 xsrc/external/mit/libXmu/dist/src/CmapAlloc.c:1.6
--- xsrc/external/mit/libXmu/dist/src/CmapAlloc.c:1.5	Fri May 31 01:19:01 2013
+++ xsrc/external/mit/libXmu/dist/src/CmapAlloc.c	Sat Oct 29 21:02:03 2022
@@ -205,7 +205,7 @@ default_allocation(XVisualInfo *vinfo, u
  * 	maximum blue value = floor(cube_root(n)) - 1;
  *	maximum green value = n / ((# red values) * (# blue values)) - 1;
  * Which, on a GPX, allows for 252 entries in the best map, out of 254
- * defineable colormap entries.
+ * definable colormap entries.
  */
 
 static void

Index: xsrc/external/mit/libXrender/dist/src/Filter.c
diff -u xsrc/external/mit/libXrender/dist/src/Filter.c:1.4 xsrc/external/mit/libXrender/dist/src/Filter.c:1.5
--- xsrc/external/mit/libXrender/dist/src/Filter.c:1.4	Tue Oct  4 22:01:49 2016
+++ xsrc/external/mit/libXrender/dist/src/Filter.c	Sat Oct 29 21:02:04 2022
@@ -30,15 +30,15 @@
 XFilters *
 XRenderQueryFilters (Display *dpy, Drawable drawable)
 {
-    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
+    XRenderExtDisplayInfo	*info = XRenderFindDisplay (dpy);
     XRenderInfo			*xri;
     xRenderQueryFiltersReq	*req;
     xRenderQueryFiltersReply	rep;
     XFilters			*filters;
     char			*name;
     char			len;
-    int				i;
-    unsigned long		nbytes, nbytesAlias, nbytesName, reply_left;
+    unsigned int		i;
+    unsigned long		nbytesName, reply_left;
 
     if (!RenderHasExtension (info))
 	return NULL;
@@ -52,9 +52,9 @@ XRenderQueryFilters (Display *dpy, Drawa
 
     LockDisplay (dpy);
     GetReq (RenderQueryFilters, req);
-    req->reqType = info->codes->major_opcode;
+    req->reqType = (CARD8) info->codes->major_opcode;
     req->renderReqType = X_RenderQueryFilters;
-    req->drawable = drawable;
+    req->drawable = (CARD32) drawable;
     if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
     {
 	UnlockDisplay (dpy);
@@ -69,6 +69,8 @@ XRenderQueryFilters (Display *dpy, Drawa
     if ((rep.length < (INT_MAX >> 2)) &&
 	(rep.numFilters < ((INT_MAX / 4) / sizeof (char *))) &&
 	(rep.numAliases < ((INT_MAX / 4) / sizeof (short)))) {
+	unsigned long		nbytes, nbytesAlias;
+
 	/*
 	 * Compute total number of bytes for filter names
 	 */
@@ -104,8 +106,8 @@ XRenderQueryFilters (Display *dpy, Drawa
      *	nbytesName  char strings
      */
 
-    filters->nfilter = rep.numFilters;
-    filters->nalias = rep.numAliases;
+    filters->nfilter = (int) rep.numFilters;
+    filters->nalias = (int) rep.numAliases;
     filters->filter = (char **) (filters + 1);
     filters->alias = (short *) (filters->filter + rep.numFilters);
     name = (char *) (filters->alias + rep.numAliases);
@@ -132,14 +134,14 @@ XRenderQueryFilters (Display *dpy, Drawa
 	    SyncHandle ();
 	    return NULL;
 	}
-	nbytesName -= l + 1;
+	nbytesName -= (unsigned long) (l + 1);
 	filters->filter[i] = name;
 	_XRead (dpy, name, l);
-        reply_left -= l;
+        reply_left -= (unsigned long) l;
 	name[l] = '\0';
 	name += l + 1;
     }
-    i = name - (char *) (filters->alias + rep.numAliases);
+    i = (unsigned) (name - (char *) (filters->alias + rep.numAliases));
 
     if (i & 3)
 	_XEatData (dpy, 4 - (i & 3));
@@ -156,20 +158,20 @@ XRenderSetPictureFilter  (Display   *dpy
 			  XFixed    *params,
 			  int	    nparams)
 {
-    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
+    XRenderExtDisplayInfo	*info = XRenderFindDisplay (dpy);
     xRenderSetPictureFilterReq	*req;
-    int				nbytes = strlen (filter);
+    int				nbytes = (int) strlen (filter);
 
     RenderSimpleCheckExtension (dpy, info);
     LockDisplay(dpy);
     GetReq(RenderSetPictureFilter, req);
-    req->reqType = info->codes->major_opcode;
+    req->reqType = (CARD8) info->codes->major_opcode;
     req->renderReqType = X_RenderSetPictureFilter;
-    req->picture = picture;
-    req->nbytes = nbytes;
-    req->length += ((nbytes + 3) >> 2) + nparams;
+    req->picture = (CARD32) picture;
+    req->nbytes = (CARD16) nbytes;
+    req->length = (CARD16) (req->length + (((nbytes + 3) >> 2) + nparams));
     Data (dpy, filter, nbytes);
-    Data (dpy, (_Xconst char *)params, nparams << 2);
+    Data (dpy, (_Xconst char *)params, (nparams << 2));
     UnlockDisplay(dpy);
     SyncHandle();
 }
Index: xsrc/external/mit/libXrender/dist/src/Xrender.c
diff -u xsrc/external/mit/libXrender/dist/src/Xrender.c:1.4 xsrc/external/mit/libXrender/dist/src/Xrender.c:1.5
--- xsrc/external/mit/libXrender/dist/src/Xrender.c:1.4	Tue Oct  4 22:01:49 2016
+++ xsrc/external/mit/libXrender/dist/src/Xrender.c	Sat Oct 29 21:02:04 2022
@@ -98,14 +98,17 @@ XRenderDepthCheckErrorHandler (Display *
     if (evt->request_code == X_CreatePixmap && evt->error_code == BadValue)
     {
 	DepthCheckPtr	d;
+
 	_XLockMutex(_Xglobal_lock);
 	for (d = depthChecks; d; d = d->next)
+	{
 	    if (d->dpy == dpy)
 	    {
 		if ((long) (evt->serial - d->serial) >= 0)
 		    d->missing |= DEPTH_MASK(evt->resourceid);
 		break;
 	    }
+        }
 	_XUnlockMutex (_Xglobal_lock);
     }
     return 0;
@@ -158,7 +161,7 @@ XRenderHasDepths (Display *dpy)
 		if ((missing & DEPTH_MASK(d)) && d != 1)
 		{
 		    Pixmap  p;
-		    p = XCreatePixmap (dpy, RootWindow (dpy, s), 1, 1, d);
+		    p = XCreatePixmap (dpy, RootWindow (dpy, s), 1, 1, (unsigned) d);
 		    XFreePixmap (dpy, p);
 		}
 	    XSync (dpy, False);
@@ -194,7 +197,7 @@ XRenderExtAddDisplay (XRenderExtInfo *ex
 {
     XRenderExtDisplayInfo *dpyinfo;
 
-    dpyinfo = (XRenderExtDisplayInfo *) Xmalloc (sizeof (XRenderExtDisplayInfo));
+    dpyinfo = Xmalloc (sizeof (XRenderExtDisplayInfo));
     if (!dpyinfo) return NULL;
     dpyinfo->display = dpy;
     dpyinfo->info = NULL;
@@ -273,7 +276,7 @@ XRenderExtRemoveDisplay (XRenderExtInfo 
     if (dpyinfo == extinfo->cur) extinfo->cur = NULL;  /* flush cache */
     _XUnlockMutex(_Xglobal_lock);
 
-    Xfree ((char *) dpyinfo);
+    Xfree (dpyinfo);
     return 1;
 }
 
@@ -292,7 +295,7 @@ XRenderFindDisplay (Display *dpy)
 }
 
 static int
-XRenderCloseDisplay (Display *dpy, XExtCodes *codes)
+XRenderCloseDisplay (Display *dpy, XExtCodes *codes _X_UNUSED)
 {
     XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
     if (info && info->info) XFree (info->info);
@@ -386,15 +389,15 @@ _XRenderVersionHandler (Display	    *dpy
 	_XGetAsyncReply(dpy, (char *)&replbuf, rep, buf, len,
 		     (SIZEOF(xRenderQueryVersionReply) - SIZEOF(xReply)) >> 2,
 			True);
-    state->major_version = repl->majorVersion;
-    state->minor_version = repl->minorVersion;
+    state->major_version = (int) repl->majorVersion;
+    state->minor_version = (int) repl->minorVersion;
     return True;
 }
 
 Status
 XRenderQueryFormats (Display *dpy)
 {
-    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
+    XRenderExtDisplayInfo	*info = XRenderFindDisplay (dpy);
     _XAsyncHandler		async;
     _XrenderVersionState	async_state;
     xRenderQueryVersionReq	*vreq;
@@ -407,11 +410,12 @@ XRenderQueryFormats (Display *dpy)
     XRenderVisual		*visual;
     xPictFormInfo		*xFormat;
     xPictScreen			*xScreen;
-    xPictDepth			*xDepth;
+    xPictDepth			*xPDepth;
     xPictVisual			*xVisual;
     CARD32			*xSubpixel;
     void			*xData;
-    int				nf, ns, nd, nv;
+    int				ns, nd;
+    unsigned			nf;
     unsigned long		rlength;
     unsigned long		nbytes;
 
@@ -423,7 +427,7 @@ XRenderQueryFormats (Display *dpy)
 	return 1;
     }
     GetReq (RenderQueryVersion, vreq);
-    vreq->reqType = info->codes->major_opcode;
+    vreq->reqType = (CARD8) info->codes->major_opcode;
     vreq->renderReqType = X_RenderQueryVersion;
     vreq->majorVersion = RENDER_MAJOR;
     vreq->minorVersion = RENDER_MINOR;
@@ -436,7 +440,7 @@ XRenderQueryFormats (Display *dpy)
     dpy->async_handlers = &async;
 
     GetReq (RenderQueryPictFormats, req);
-    req->reqType = info->codes->major_opcode;
+    req->reqType = (CARD8) info->codes->major_opcode;
     req->renderReqType = X_RenderQueryPictFormats;
 
     if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
@@ -495,14 +499,14 @@ XRenderQueryFormats (Display *dpy)
     xri->major_version = async_state.major_version;
     xri->minor_version = async_state.minor_version;
     xri->format = (XRenderPictFormat *) (xri + 1);
-    xri->nformat = rep.numFormats;
+    xri->nformat = (int) rep.numFormats;
     xri->screen = (XRenderScreen *) (xri->format + rep.numFormats);
-    xri->nscreen = rep.numScreens;
+    xri->nscreen = (int) rep.numScreens;
     xri->depth = (XRenderDepth *) (xri->screen + rep.numScreens);
-    xri->ndepth = rep.numDepths;
+    xri->ndepth = (int) rep.numDepths;
     xri->visual = (XRenderVisual *) (xri->depth + rep.numDepths);
-    xri->nvisual = rep.numVisuals;
-    _XRead (dpy, (char *) xData, rlength);
+    xri->nvisual = (int) rep.numVisuals;
+    _XRead (dpy, (char *) xData, (long) rlength);
     format = xri->format;
     xFormat = (xPictFormInfo *) xData;
     for (nf = 0; nf < rep.numFormats; nf++)
@@ -510,14 +514,14 @@ XRenderQueryFormats (Display *dpy)
 	format->id = xFormat->id;
 	format->type = xFormat->type;
 	format->depth = xFormat->depth;
-	format->direct.red = xFormat->direct.red;
-	format->direct.redMask = xFormat->direct.redMask;
-	format->direct.green = xFormat->direct.green;
-	format->direct.greenMask = xFormat->direct.greenMask;
-	format->direct.blue = xFormat->direct.blue;
-	format->direct.blueMask = xFormat->direct.blueMask;
-	format->direct.alpha = xFormat->direct.alpha;
-	format->direct.alphaMask = xFormat->direct.alphaMask;
+	format->direct.red       = (short) xFormat->direct.red;
+	format->direct.redMask   = (short) xFormat->direct.redMask;
+	format->direct.green     = (short) xFormat->direct.green;
+	format->direct.greenMask = (short) xFormat->direct.greenMask;
+	format->direct.blue      = (short) xFormat->direct.blue;
+	format->direct.blueMask  = (short) xFormat->direct.blueMask;
+	format->direct.alpha     = (short) xFormat->direct.alpha;
+	format->direct.alphaMask = (short) xFormat->direct.alphaMask;
 	format->colormap = xFormat->colormap;
 	format++;
 	xFormat++;
@@ -529,10 +533,10 @@ XRenderQueryFormats (Display *dpy)
     for (ns = 0; ns < xri->nscreen; ns++)
     {
 	screen->depths = depth;
-	screen->ndepths = xScreen->nDepth;
+	screen->ndepths = (int) xScreen->nDepth;
 	screen->fallback = _XRenderFindFormat (xri, xScreen->fallback);
 	screen->subpixel = SubPixelUnknown;
-	xDepth = (xPictDepth *) (xScreen + 1);
+	xPDepth = (xPictDepth *) (xScreen + 1);
 	if (screen->ndepths > rep.numDepths) {
 	    Xfree (xri);
 	    Xfree (xData);
@@ -541,13 +545,15 @@ XRenderQueryFormats (Display *dpy)
 	    SyncHandle ();
 	    return 0;
 	}
-	rep.numDepths -= screen->ndepths;
+	rep.numDepths -= (CARD32) screen->ndepths;
 	for (nd = 0; nd < screen->ndepths; nd++)
 	{
-	    depth->depth = xDepth->depth;
-	    depth->nvisuals = xDepth->nPictVisuals;
+	    int nv;
+
+	    depth->depth = xPDepth->depth;
+	    depth->nvisuals = xPDepth->nPictVisuals;
 	    depth->visuals = visual;
-	    xVisual = (xPictVisual *) (xDepth + 1);
+	    xVisual = (xPictVisual *) (xPDepth + 1);
 	    if (depth->nvisuals > rep.numVisuals) {
 		Xfree (xri);
 		Xfree (xData);
@@ -556,7 +562,7 @@ XRenderQueryFormats (Display *dpy)
 		SyncHandle ();
 		return 0;
 	    }
-	    rep.numVisuals -= depth->nvisuals;
+	    rep.numVisuals -= (CARD32) depth->nvisuals;
 	    for (nv = 0; nv < depth->nvisuals; nv++)
 	    {
 		visual->visual = _XRenderFindVisual (dpy, xVisual->visual);
@@ -565,16 +571,16 @@ XRenderQueryFormats (Display *dpy)
 		xVisual++;
 	    }
 	    depth++;
-	    xDepth = (xPictDepth *) xVisual;
+	    xPDepth = (xPictDepth *) xVisual;
 	}
 	screen++;
-	xScreen = (xPictScreen *) xDepth;
+	xScreen = (xPictScreen *) xPDepth;
     }
     xSubpixel = (CARD32 *) xScreen;
     screen = xri->screen;
     for (ns = 0; ns < rep.numSubpixel; ns++)
     {
-	screen->subpixel = *xSubpixel;
+	screen->subpixel = (int) *xSubpixel;
 	xSubpixel++;
 	screen++;
     }
@@ -858,19 +864,19 @@ XRenderQueryPictIndexValues(Display			*d
 			    _Xconst XRenderPictFormat	*format,
 			    int				*num)
 {
-    XRenderExtDisplayInfo			*info = XRenderFindDisplay (dpy);
+    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
     xRenderQueryPictIndexValuesReq	*req;
     xRenderQueryPictIndexValuesReply	rep;
     XIndexValue				*values;
-    unsigned int			nbytes, nread, rlength, i;
+    unsigned int			nbytes, nread, i;
 
     RenderCheckExtension (dpy, info, NULL);
 
     LockDisplay (dpy);
     GetReq (RenderQueryPictIndexValues, req);
-    req->reqType = info->codes->major_opcode;
+    req->reqType       = (CARD8) info->codes->major_opcode;
     req->renderReqType = X_RenderQueryPictIndexValues;
-    req->format = format->id;
+    req->format        = (CARD32) format->id;
     if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
     {
 	UnlockDisplay (dpy);
@@ -880,17 +886,18 @@ XRenderQueryPictIndexValues(Display			*d
 
     if ((rep.length < (INT_MAX >> 2)) &&
 	(rep.numIndexValues < (INT_MAX / sizeof (XIndexValue)))) {
+	unsigned int rlength;
 	/* request data length */
 	nbytes = rep.length << 2;
 	/* bytes of actual data in the request */
 	nread = rep.numIndexValues * SIZEOF (xIndexValue);
 	/* size of array returned to application */
-	rlength = rep.numIndexValues * sizeof (XIndexValue);
+	rlength = (unsigned) ((unsigned long) rep.numIndexValues * sizeof (XIndexValue));
 
 	/* allocate returned data */
 	values = Xmalloc (rlength);
     } else {
-	nbytes = nread = rlength = 0;
+	nbytes = nread = 0;
 	values = NULL;
     }
 
@@ -903,8 +910,8 @@ XRenderQueryPictIndexValues(Display			*d
     }
 
     /* read the values one at a time and convert */
-    *num = rep.numIndexValues;
-    for(i = 0; i < rep.numIndexValues; i++)
+    *num = (int) rep.numIndexValues;
+    for (i = 0; i < rep.numIndexValues; i++)
     {
 	xIndexValue value;
 

Index: xsrc/external/mit/libxkbfile/dist/src/cout.c
diff -u xsrc/external/mit/libxkbfile/dist/src/cout.c:1.3 xsrc/external/mit/libxkbfile/dist/src/cout.c:1.4
--- xsrc/external/mit/libxkbfile/dist/src/cout.c:1.3	Sun Jul 19 05:52:54 2015
+++ xsrc/external/mit/libxkbfile/dist/src/cout.c	Sat Oct 29 21:02:04 2022
@@ -826,10 +826,6 @@ WriteCHdrGeomSections(FILE *file, XkbDes
     for (s = 0, section = geom->sections; s < geom->num_sections;
          s++, section++) {
         WriteCHdrGeomRows(file, xkb, section, s);
-#ifdef NOTYET
-        if (section->num_doodads > 0)
-            WriteCHdrGeomDoodads(file, xkb, geom, section, s);
-#endif
         if (section->num_overlays > 0)
             WriteCHdrGeomOverlays(file, xkb, section, s);
     }

Index: xsrc/external/mit/libxshmfence/dist/src/xshmfence_alloc.c
diff -u xsrc/external/mit/libxshmfence/dist/src/xshmfence_alloc.c:1.2 xsrc/external/mit/libxshmfence/dist/src/xshmfence_alloc.c:1.3
--- xsrc/external/mit/libxshmfence/dist/src/xshmfence_alloc.c:1.2	Sun Aug 14 03:43:37 2016
+++ xsrc/external/mit/libxshmfence/dist/src/xshmfence_alloc.c	Sat Oct 29 21:02:04 2022
@@ -26,6 +26,8 @@
 
 #include "xshmfenceint.h"
 
+#include <fcntl.h>
+
 #if !HAVE_MEMFD_CREATE
 #if HAVE_DECL___NR_MEMFD_CREATE
 #include <asm/unistd.h>
@@ -68,21 +70,39 @@ xshmfence_alloc_shm(void)
 {
 	char	template[] = SHMDIR "/shmfd-XXXXXX";
 	int	fd;
+#ifndef HAVE_MKOSTEMP
+	int	flags;
+#endif
 
 #if HAVE_MEMFD_CREATE
 	fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING);
 	if (fd < 0)
 #endif
+#ifdef SHM_ANON
+	fd = shm_open(SHM_ANON, O_RDWR|O_CLOEXEC, 0600);
+	if (fd < 0)
+#endif
 	{
 #ifdef O_TMPFILE
 		fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
 		if (fd < 0)
 #endif
 		{
+#ifdef HAVE_MKOSTEMP
+			fd = mkostemp(template, O_CLOEXEC);
+#else
 			fd = mkstemp(template);
+#endif
 			if (fd < 0)
 				return fd;
 			unlink(template);
+#ifndef HAVE_MKOSTEMP
+			flags = fcntl(fd, F_GETFD);
+			if (flags != -1) {
+				flags |= FD_CLOEXEC;
+				fcntl(fd, F_SETFD, &flags);
+			}
+#endif
 		}
 	}
 	if (ftruncate(fd, sizeof (struct xshmfence)) < 0) {

Reply via email to