(!1893) dix: write out X_InternAtom 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
							
								
									5682ffe50d
								
							
						
					
					
						commit
						4e5c48b48f
					
				|  | @ -1090,18 +1090,22 @@ ProcInternAtom(ClientPtr client) | |||
|     } | ||||
|     tchar = (char *) &stuff[1]; | ||||
|     atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); | ||||
|     if (atom != BAD_RESOURCE) { | ||||
|         xInternAtomReply reply = { | ||||
|     if (atom == BAD_RESOURCE) | ||||
|         return BadAlloc; | ||||
| 
 | ||||
|     xInternAtomReply rep = { | ||||
|         .type = X_Reply, | ||||
|         .sequenceNumber = client->sequence, | ||||
|         .length = 0, | ||||
|         .atom = atom | ||||
|     }; | ||||
|         WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); | ||||
|         return Success; | ||||
| 
 | ||||
|     if (client->swapped) { | ||||
|         swaps(&rep.sequenceNumber); | ||||
|         swapl(&rep.atom); | ||||
|     } | ||||
|     else | ||||
|         return BadAlloc; | ||||
|     WriteToClient(client, sizeof(rep), &rep); | ||||
|     return Success; | ||||
| } | ||||
| 
 | ||||
| int | ||||
|  |  | |||
|  | @ -183,14 +183,6 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep) | |||
|     WriteToClient(pClient, size, pRep); | ||||
| } | ||||
| 
 | ||||
| void _X_COLD | ||||
| SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep) | ||||
| { | ||||
|     swaps(&pRep->sequenceNumber); | ||||
|     swapl(&pRep->atom); | ||||
|     WriteToClient(pClient, size, pRep); | ||||
| } | ||||
| 
 | ||||
| void _X_COLD | ||||
| SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep) | ||||
| { | ||||
|  |  | |||
|  | @ -731,7 +731,7 @@ ReplySwapPtr ReplySwapVector[256] = { | |||
|     ReplyNotSwappd, | ||||
|     ReplyNotSwappd, | ||||
|     ReplyNotSwappd,                             /* 15 */ | ||||
|     (ReplySwapPtr) SInternAtomReply, | ||||
|     ReplyNotSwappd, | ||||
|     (ReplySwapPtr) SGetAtomNameReply, | ||||
|     ReplyNotSwappd, | ||||
|     ReplyNotSwappd, | ||||
|  |  | |||
|  | @ -42,10 +42,6 @@ extern void SGenericReply(ClientPtr /* pClient */ , | |||
|                           int /* size */ , | ||||
|                           xGenericReply * /* pRep */ ); | ||||
| 
 | ||||
| extern void SInternAtomReply(ClientPtr /* pClient */ , | ||||
|                              int /* size */ , | ||||
|                              xInternAtomReply * /* pRep */ ); | ||||
| 
 | ||||
| extern void SGetAtomNameReply(ClientPtr /* pClient */ , | ||||
|                               int /* size */ , | ||||
|                               xGetAtomNameReply * /* pRep */ ); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue