Module Name:    xsrc
Committed By:   mrg
Date:           Tue Sep 27 18:23:26 UTC 2022

Modified Files:
        xsrc/external/mit/libXtst/dist/man: XTestQueryExtension.man
        xsrc/external/mit/libXtst/dist/src: XRecord.c XTest.c
        xsrc/external/mit/libXxf86vm/dist/src: XF86VMode.c
Removed Files:
        xsrc/external/mit/libXtst/dist: README
        xsrc/external/mit/libXxf86vm/dist: README

Log Message:
merge libXtst-1.2.4 and libXxf86vm-1.1.5


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r0 xsrc/external/mit/libXtst/dist/README
cvs rdiff -u -r1.6 -r1.7 \
    xsrc/external/mit/libXtst/dist/man/XTestQueryExtension.man
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/libXtst/dist/src/XRecord.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libXtst/dist/src/XTest.c
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/libXxf86vm/dist/README
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.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/libXtst/dist/man/XTestQueryExtension.man
diff -u xsrc/external/mit/libXtst/dist/man/XTestQueryExtension.man:1.6 xsrc/external/mit/libXtst/dist/man/XTestQueryExtension.man:1.7
--- xsrc/external/mit/libXtst/dist/man/XTestQueryExtension.man:1.6	Tue Oct  4 22:01:49 2016
+++ xsrc/external/mit/libXtst/dist/man/XTestQueryExtension.man	Tue Sep 27 18:23:26 2022
@@ -1,7 +1,7 @@
 '\" t
 .\"     Title: XTest
 .\"    Author: Kieron Drake
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
+.\" Generator: DocBook XSL Stylesheets vsnapshot_9276 <http://docbook.sf.net/>
 .\"      Date: <pubdate>6 June 2007</pubdate>
 .\"    Manual: XTST FUNCTIONS
 .\"    Source: __xorgversion__

Index: xsrc/external/mit/libXtst/dist/src/XRecord.c
diff -u xsrc/external/mit/libXtst/dist/src/XRecord.c:1.6 xsrc/external/mit/libXtst/dist/src/XRecord.c:1.7
--- xsrc/external/mit/libXtst/dist/src/XRecord.c:1.6	Fri Oct  7 16:05:13 2016
+++ xsrc/external/mit/libXtst/dist/src/XRecord.c	Tue Sep 27 18:23:26 2022
@@ -166,7 +166,7 @@ static XPointer alloc_mem_cache(void)
     struct mem_cache_str *cache;
 
     /* note that an error will go unnoticed */
-    cache = (struct mem_cache_str *) Xmalloc(sizeof(struct mem_cache_str));
+    cache = Xmalloc(sizeof(struct mem_cache_str));
     if (cache) {
 	cache->display_closed = False;
 	cache->inter_data = NULL;
@@ -317,7 +317,7 @@ XRecordCreateContext(Display *dpy, int d
 XRecordRange *
 XRecordAllocRange(void)
 {
-    return (XRecordRange*)Xcalloc(1, sizeof(XRecordRange));
+    return Xcalloc(1, sizeof(XRecordRange));
 }
 
 Status
@@ -409,7 +409,7 @@ XRecordGetContext(Display *dpy, XRecordC
     XExtDisplayInfo 	*info = find_display (dpy);
     register 		xRecordGetContextReq   	*req;
     xRecordGetContextReply 	rep;
-    unsigned int	count, i, rn;
+    unsigned int	count;
     xRecordRange   	xrange;
     xRecordClientInfo   xclient_inf;
     XRecordState	*ret;
@@ -427,7 +427,7 @@ XRecordGetContext(Display *dpy, XRecordC
     }
     count = rep.nClients;
 
-    ret = (XRecordState*)Xmalloc(sizeof(XRecordState));
+    ret = Xmalloc(sizeof(XRecordState));
     if (!ret) {
 	_XEatDataWords (dpy, rep.length);
 	UnlockDisplay(dpy);
@@ -459,7 +459,7 @@ XRecordGetContext(Display *dpy, XRecordC
 	   SyncHandle();
 	   return 0;
         }
-        for(i = 0; i < count; i++)
+        for (unsigned int i = 0; i < count; i++)
         {
 	    client_inf[i] = &(client_inf_str[i]);
             _XRead(dpy, (char *)&xclient_inf, (long)sizeof(xRecordClientInfo));
@@ -487,7 +487,7 @@ XRecordGetContext(Display *dpy, XRecordC
 		    SyncHandle();
 		    return 0;
 		}
-		for (rn=0; rn<xclient_inf.nRanges; rn++) {
+		for (unsigned int rn = 0; rn < xclient_inf.nRanges; rn++) {
 		    client_inf_str[i].ranges[rn] = &(ranges[rn]);
 		    _XRead(dpy, (char *)&xrange, (long)sizeof(xRecordRange));
 		    WireToLibRange(&xrange, &(ranges[rn]));
@@ -510,9 +510,7 @@ XRecordGetContext(Display *dpy, XRecordC
 void
 XRecordFreeState(XRecordState *state)
 {
-    int i;
-
-    for(i=0; i<state->nclients; i++) {
+    for (unsigned long i = 0; i < state->nclients; i++) {
 	if (state->client_info[i]->ranges) {
 	    if (state->client_info[i]->ranges[0])
 		Xfree(state->client_info[i]->ranges[0]);
@@ -560,10 +558,10 @@ static struct reply_buffer *alloc_reply_
     /*
      * nothing available; malloc a new struct
      */
-    rbp = (struct reply_buffer *)Xmalloc(sizeof(struct reply_buffer));
+    rbp = Xmalloc(sizeof(struct reply_buffer));
     if (!rbp)
 	return NULL;
-    rbp->buf = (unsigned char *)Xmalloc(nbytes);
+    rbp->buf = Xmalloc(nbytes);
     if (!rbp->buf) {
 	Xfree(rbp);
 	return NULL;
@@ -587,7 +585,7 @@ static XRecordInterceptData *alloc_inter
 	return &iq->data;
     }
     /* allocate a new one */
-    iq = (struct intercept_queue *)Xmalloc(sizeof(struct intercept_queue));
+    iq = Xmalloc(sizeof(struct intercept_queue));
     if (!iq)
 	return NULL;
     iq->cache = cache;
@@ -727,14 +725,13 @@ parse_reply_call_callback(
     XRecordInterceptProc callback,
     XPointer		 closure)
 {
-    int current_index;
+    unsigned int current_index;
     int datum_bytes = 0;
-    XRecordInterceptData *data;
 
     /* call the callback for each protocol element in the reply */
     current_index = 0;
     do {
-	data = alloc_inter_data(info);
+	XRecordInterceptData *data = alloc_inter_data(info);
 	if (!data)
 	    return Error;
 
@@ -875,7 +872,6 @@ XRecordEnableContext(Display *dpy, XReco
     register xRecordEnableContextReq   	*req;
     xRecordEnableContextReply 	rep;
     struct reply_buffer *reply;
-    enum parser_return status;
 
     XRecordCheckExtension (dpy, info, 0);
     LockDisplay(dpy);
@@ -887,6 +883,8 @@ XRecordEnableContext(Display *dpy, XReco
 
     while (1)
     {
+	enum parser_return status;
+
 	/* This code should match that in XRecordEnableContextAsync */
 	if (!_XReply (dpy, (xReply *)&rep, 0, xFalse))
 	{
@@ -1020,8 +1018,7 @@ XRecordEnableContextAsync(Display *dpy, 
     record_async_state *async_state;
 
     XRecordCheckExtension (dpy, info, 0);
-    async = (_XAsyncHandler *)Xmalloc(sizeof(_XAsyncHandler) +
-	sizeof(record_async_state));
+    async = Xmalloc(sizeof(_XAsyncHandler) + sizeof(record_async_state));
     if (!async)
 	return 0;
     async_state = (record_async_state *)(async + 1);

Index: xsrc/external/mit/libXtst/dist/src/XTest.c
diff -u xsrc/external/mit/libXtst/dist/src/XTest.c:1.3 xsrc/external/mit/libXtst/dist/src/XTest.c:1.4
--- xsrc/external/mit/libXtst/dist/src/XTest.c:1.3	Mon Jun  3 04:37:59 2013
+++ xsrc/external/mit/libXtst/dist/src/XTest.c	Tue Sep 27 18:23:26 2022
@@ -99,10 +99,11 @@ XTestQueryExtension (Display *dpy,
 		     int *major_return, int *minor_return)
 {
     XExtDisplayInfo *info = find_display (dpy);
-    register xXTestGetVersionReq *req;
     xXTestGetVersionReply rep;
 
     if (XextHasExtension(info)) {
+	xXTestGetVersionReq *req;
+
 	LockDisplay(dpy);
 	GetReq(XTestGetVersion, req);
 	req->reqType = info->codes->major_opcode;
@@ -259,7 +260,6 @@ send_axes(
     int n_axes)
 {
     deviceValuator ev;
-    int n;
 
     req->deviceid |= MORE_EVENTS;
     req->length += ((n_axes + 5) / 6) * (SIZEOF(xEvent) >> 2);
@@ -267,19 +267,24 @@ send_axes(
     ev.deviceid = dev->device_id;
     ev.first_valuator = first_axis;
     while (n_axes > 0) {
-	n = n_axes > 6 ? 6 : n_axes;
+	int n = n_axes > 6 ? 6 : n_axes;
 	ev.num_valuators = n;
 	switch (n) {
 	case 6:
 	    ev.valuator5 = *(axes+5);
+	    /* fallthrough */
 	case 5:
 	    ev.valuator4 = *(axes+4);
+	    /* fallthrough */
 	case 4:
 	    ev.valuator3 = *(axes+3);
+	    /* fallthrough */
 	case 3:
 	    ev.valuator2 = *(axes+2);
+	    /* fallthrough */
 	case 2:
 	    ev.valuator1 = *(axes+1);
+	    /* fallthrough */
 	case 1:
 	    ev.valuator0 = *axes;
 	}
@@ -428,11 +433,10 @@ Status
 XTestDiscard(Display *dpy)
 {
     Bool something;
-    register char *ptr;
 
     LockDisplay(dpy);
     if ((something = (dpy->bufptr != dpy->buffer))) {
-	for (ptr = dpy->buffer;
+	for (char *ptr = dpy->buffer;
 	     ptr < dpy->bufptr;
 	     ptr += (((xReq *)ptr)->length << 2))
 	    dpy->request--;

Index: xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.c
diff -u xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.c:1.4 xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.c:1.5
--- xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.c:1.4	Sun Jul 19 23:23:18 2015
+++ xsrc/external/mit/libXxf86vm/dist/src/XF86VMode.c	Tue Sep 27 18:23:26 2022
@@ -267,7 +267,7 @@ XF86VidModeGetModeLine(Display* dpy, int
     }
 
     if (modeline->privsize > 0) {
-	if (modeline->privsize < (INT_MAX / sizeof(INT32)))
+	if ((unsigned) modeline->privsize < (INT_MAX / sizeof(INT32)))
 	    modeline->private = Xcalloc(modeline->privsize, sizeof(INT32));
 	else
 	    modeline->private = NULL;
@@ -418,14 +418,8 @@ XF86VidModeGetAllModeLines(Display* dpy,
  * GetReq replacement for use with VidMode protocols earlier than 2.0
  */
 #define GetOldReq(name, oldname, req) \
-        WORD64ALIGN\
-	if ((dpy->bufptr + SIZEOF(x##oldname##Req)) > dpy->bufmax)\
-		_XFlush(dpy);\
-	req = (x##oldname##Req *)(dpy->last_req = dpy->bufptr);\
-	req->reqType = X_##name;\
-	req->length = (SIZEOF(x##oldname##Req))>>2;\
-	dpy->bufptr += SIZEOF(x##oldname##Req);\
-	dpy->request++
+	req = (x##oldname##Req *) \
+	    _XGetRequest(dpy, X_##name, SIZEOF(x##oldname##Req))
 
 Bool
 XF86VidModeAddModeLine(Display *dpy, int screen,
@@ -433,8 +427,6 @@ XF86VidModeAddModeLine(Display *dpy, int
 		       XF86VidModeModeInfo* aftermodeline)
 {
     XExtDisplayInfo *info = find_display (dpy);
-    xXF86VidModeAddModeLineReq *req;
-    xXF86OldVidModeAddModeLineReq *oldreq;
     int majorVersion, minorVersion;
 
     XF86VidModeCheckExtension (dpy, info, False);
@@ -442,6 +434,8 @@ XF86VidModeAddModeLine(Display *dpy, int
 
     LockDisplay(dpy);
     if (_X_UNLIKELY(majorVersion < 2)) {
+	xXF86OldVidModeAddModeLineReq *oldreq;
+
 	GetOldReq(XF86VidModeAddModeLine, XF86OldVidModeAddModeLine, oldreq);
 	oldreq->reqType = info->codes->major_opcode;
 	oldreq->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
@@ -486,6 +480,8 @@ XF86VidModeAddModeLine(Display *dpy, int
 	       newmodeline->privsize * sizeof(INT32));
 	}
     } else {
+	xXF86VidModeAddModeLineReq *req;
+
 	GetReq(XF86VidModeAddModeLine, req);
 	req->reqType = info->codes->major_opcode;
 	req->xf86vidmodeReqType = X_XF86VidModeAddModeLine;
@@ -543,8 +539,6 @@ XF86VidModeDeleteModeLine(Display *dpy, 
 			  XF86VidModeModeInfo* modeline)
 {
     XExtDisplayInfo *info = find_display (dpy);
-    xXF86VidModeDeleteModeLineReq *req;
-    xXF86OldVidModeDeleteModeLineReq *oldreq;
     int majorVersion, minorVersion;
 
     XF86VidModeCheckExtension (dpy, info, 0);
@@ -552,6 +546,8 @@ XF86VidModeDeleteModeLine(Display *dpy, 
 
     LockDisplay(dpy);
     if (_X_UNLIKELY(majorVersion < 2)) {
+	xXF86OldVidModeDeleteModeLineReq *oldreq;
+
 	GetOldReq(XF86VidModeDeleteModeLine, XF86OldVidModeDeleteModeLine, oldreq);
 	oldreq->reqType = info->codes->major_opcode;
 	oldreq->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
@@ -573,6 +569,8 @@ XF86VidModeDeleteModeLine(Display *dpy, 
 	       modeline->privsize * sizeof(INT32));
 	}
     } else {
+	xXF86VidModeDeleteModeLineReq *req;
+
 	GetReq(XF86VidModeDeleteModeLine, req);
 	req->reqType = info->codes->major_opcode;
 	req->xf86vidmodeReqType = X_XF86VidModeDeleteModeLine;
@@ -604,8 +602,6 @@ Bool
 XF86VidModeModModeLine(Display *dpy, int screen, XF86VidModeModeLine* modeline)
 {
     XExtDisplayInfo *info = find_display (dpy);
-    xXF86VidModeModModeLineReq *req;
-    xXF86OldVidModeModModeLineReq *oldreq;
     int majorVersion, minorVersion;
 
     XF86VidModeCheckExtension (dpy, info, 0);
@@ -613,6 +609,8 @@ XF86VidModeModModeLine(Display *dpy, int
 
     LockDisplay(dpy);
     if (_X_UNLIKELY(majorVersion < 2)) {
+	xXF86OldVidModeModModeLineReq *oldreq;
+
 	GetOldReq(XF86VidModeModModeLine, XF86OldVidModeModModeLine, oldreq);
 	oldreq->reqType = info->codes->major_opcode;
 	oldreq->xf86vidmodeReqType = X_XF86VidModeModModeLine;
@@ -633,6 +631,8 @@ XF86VidModeModModeLine(Display *dpy, int
 	       modeline->privsize * sizeof(INT32));
 	}
     } else {
+	xXF86VidModeModModeLineReq *req;
+
 	GetReq(XF86VidModeModModeLine, req);
 	req->reqType = info->codes->major_opcode;
 	req->xf86vidmodeReqType = X_XF86VidModeModModeLine;
@@ -664,8 +664,6 @@ XF86VidModeValidateModeLine(Display *dpy
 			    XF86VidModeModeInfo* modeline)
 {
     XExtDisplayInfo *info = find_display (dpy);
-    xXF86VidModeValidateModeLineReq *req;
-    xXF86OldVidModeValidateModeLineReq *oldreq;
     xXF86VidModeValidateModeLineReply rep;
     int majorVersion, minorVersion;
 
@@ -675,6 +673,8 @@ XF86VidModeValidateModeLine(Display *dpy
     LockDisplay(dpy);
 
     if (_X_UNLIKELY(majorVersion < 2)) {
+	xXF86OldVidModeValidateModeLineReq *oldreq;
+
 	GetOldReq(XF86VidModeValidateModeLine, XF86OldVidModeValidateModeLine, oldreq);
 	oldreq->reqType = info->codes->major_opcode;
 	oldreq->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;
@@ -696,6 +696,8 @@ XF86VidModeValidateModeLine(Display *dpy
 	       modeline->privsize * sizeof(INT32));
 	}
     } else {
+	xXF86VidModeValidateModeLineReq *req;
+
 	GetReq(XF86VidModeValidateModeLine, req);
 	req->reqType = info->codes->major_opcode;
 	req->xf86vidmodeReqType = X_XF86VidModeValidateModeLine;

Reply via email to