(!1893) dix: write out X_GetFontPath 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
							
								
									3687bcb7d5
								
							
						
					
					
						commit
						4914753bb5
					
				| 
						 | 
				
			
			@ -3496,7 +3496,6 @@ ProcSetFontPath(ClientPtr client)
 | 
			
		|||
int
 | 
			
		||||
ProcGetFontPath(ClientPtr client)
 | 
			
		||||
{
 | 
			
		||||
    xGetFontPathReply reply;
 | 
			
		||||
    int rc, stringLens, numpaths;
 | 
			
		||||
    unsigned char *bufferStart;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -3507,15 +3506,19 @@ ProcGetFontPath(ClientPtr client)
 | 
			
		|||
    if (rc != Success)
 | 
			
		||||
        return rc;
 | 
			
		||||
 | 
			
		||||
    reply = (xGetFontPathReply) {
 | 
			
		||||
    xGetFontPathReply rep = {
 | 
			
		||||
        .type = X_Reply,
 | 
			
		||||
        .sequenceNumber = client->sequence,
 | 
			
		||||
        .length = bytes_to_int32(stringLens + numpaths),
 | 
			
		||||
        .nPaths = numpaths
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
 | 
			
		||||
    if (stringLens || numpaths)
 | 
			
		||||
    if (client->swapped) {
 | 
			
		||||
        swaps(&rep.sequenceNumber);
 | 
			
		||||
        swapl(&rep.length);
 | 
			
		||||
        swaps(&rep.nPaths);
 | 
			
		||||
    }
 | 
			
		||||
    WriteToClient(client, sizeof(rep), &rep);
 | 
			
		||||
    WriteToClient(client, stringLens + numpaths, bufferStart);
 | 
			
		||||
    return Success;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -301,15 +301,6 @@ SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _X_COLD
 | 
			
		||||
SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
 | 
			
		||||
{
 | 
			
		||||
    swaps(&pRep->sequenceNumber);
 | 
			
		||||
    swapl(&pRep->length);
 | 
			
		||||
    swaps(&pRep->nPaths);
 | 
			
		||||
    WriteToClient(pClient, size, pRep);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _X_COLD
 | 
			
		||||
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -765,7 +765,7 @@ ReplySwapPtr ReplySwapVector[256] = {
 | 
			
		|||
    ReplyNotSwappd,
 | 
			
		||||
    ReplyNotSwappd,                             /* 50 */
 | 
			
		||||
    ReplyNotSwappd,
 | 
			
		||||
    (ReplySwapPtr) SGetFontPathReply,
 | 
			
		||||
    ReplyNotSwappd,
 | 
			
		||||
    ReplyNotSwappd,
 | 
			
		||||
    ReplyNotSwappd,
 | 
			
		||||
    ReplyNotSwappd,                             /* 55 */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,10 +64,6 @@ extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
 | 
			
		|||
                                int /* size */ ,
 | 
			
		||||
                                xGetInputFocusReply * /* pRep */ );
 | 
			
		||||
 | 
			
		||||
extern void SGetFontPathReply(ClientPtr /* pClient */ ,
 | 
			
		||||
                              int /* size */ ,
 | 
			
		||||
                              xGetFontPathReply * /* pRep */ );
 | 
			
		||||
 | 
			
		||||
extern void SListExtensionsReply(ClientPtr /* pClient */ ,
 | 
			
		||||
                                 int /* size */ ,
 | 
			
		||||
                                 xListExtensionsReply * /* pRep */ );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue