dix: write out X_GetGeometry reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									31207481e2
								
							
						
					
					
						commit
						345daa5830
					
				|  | @ -557,7 +557,6 @@ PanoramiXCirculateWindow(ClientPtr client) | |||
| int | ||||
| PanoramiXGetGeometry(ClientPtr client) | ||||
| { | ||||
|     xGetGeometryReply rep; | ||||
|     DrawablePtr pDraw; | ||||
|     int rc; | ||||
| 
 | ||||
|  | @ -568,7 +567,7 @@ PanoramiXGetGeometry(ClientPtr client) | |||
|     if (rc != Success) | ||||
|         return rc; | ||||
| 
 | ||||
|     rep = (xGetGeometryReply) { | ||||
|     xGetGeometryReply rep = { | ||||
|         .type = X_Reply, | ||||
|         .sequenceNumber = client->sequence, | ||||
|         .length = 0, | ||||
|  | @ -602,7 +601,16 @@ PanoramiXGetGeometry(ClientPtr client) | |||
|         rep.borderWidth = pWin->borderWidth; | ||||
|     } | ||||
| 
 | ||||
|     WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); | ||||
|     if (client->swapped) { | ||||
|         swaps(&rep.sequenceNumber); | ||||
|         swapl(&rep.root); | ||||
|         swaps(&rep.x); | ||||
|         swaps(&rep.y); | ||||
|         swaps(&rep.width); | ||||
|         swaps(&rep.height); | ||||
|         swaps(&rep.borderWidth); | ||||
|     } | ||||
|     WriteToClient(client, sizeof(xGetGeometryReply), &rep); | ||||
|     return Success; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1044,7 +1044,16 @@ ProcGetGeometry(ClientPtr client) | |||
|         rep.borderWidth = pWin->borderWidth; | ||||
|     } | ||||
| 
 | ||||
|     WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep); | ||||
|     if (client->swapped) { | ||||
|         swaps(&rep.sequenceNumber); | ||||
|         swapl(&rep.root); | ||||
|         swaps(&rep.x); | ||||
|         swaps(&rep.y); | ||||
|         swaps(&rep.width); | ||||
|         swaps(&rep.height); | ||||
|         swaps(&rep.borderWidth); | ||||
|     } | ||||
|     WriteToClient(client, sizeof(xGetGeometryReply), &rep); | ||||
|     return Success; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -201,19 +201,6 @@ SGetWindowAttributesReply(ClientPtr pClient, int size, | |||
|     WriteToClient(pClient, size, pRep); | ||||
| } | ||||
| 
 | ||||
| void _X_COLD | ||||
| SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep) | ||||
| { | ||||
|     swaps(&pRep->sequenceNumber); | ||||
|     swapl(&pRep->root); | ||||
|     swaps(&pRep->x); | ||||
|     swaps(&pRep->y); | ||||
|     swaps(&pRep->width); | ||||
|     swaps(&pRep->height); | ||||
|     swaps(&pRep->borderWidth); | ||||
|     WriteToClient(pClient, size, pRep); | ||||
| } | ||||
| 
 | ||||
| void _X_COLD | ||||
| SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep) | ||||
| { | ||||
|  |  | |||
|  | @ -726,7 +726,7 @@ ReplySwapPtr ReplySwapVector[256] = { | |||
|     ReplyNotSwappd, | ||||
|     ReplyNotSwappd, | ||||
|     ReplyNotSwappd, | ||||
|     (ReplySwapPtr) SGetGeometryReply, | ||||
|     ReplyNotSwappd, | ||||
|     (ReplySwapPtr) SQueryTreeReply,             /* 15 */ | ||||
|     (ReplySwapPtr) SInternAtomReply, | ||||
|     (ReplySwapPtr) SGetAtomNameReply, | ||||
|  |  | |||
|  | @ -47,10 +47,6 @@ extern void SGetWindowAttributesReply(ClientPtr /* pClient */ , | |||
|                                       xGetWindowAttributesReply * | ||||
|                                       /* pRep */ ); | ||||
| 
 | ||||
| extern void SGetGeometryReply(ClientPtr /* pClient */ , | ||||
|                               int /* size */ , | ||||
|                               xGetGeometryReply * /* pRep */ ); | ||||
| 
 | ||||
| extern void SQueryTreeReply(ClientPtr /* pClient */ , | ||||
|                             int /* size */ , | ||||
|                             xQueryTreeReply * /* pRep */ ); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue