(!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
 | 
					int
 | 
				
			||||||
ProcGetFontPath(ClientPtr client)
 | 
					ProcGetFontPath(ClientPtr client)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    xGetFontPathReply reply;
 | 
					 | 
				
			||||||
    int rc, stringLens, numpaths;
 | 
					    int rc, stringLens, numpaths;
 | 
				
			||||||
    unsigned char *bufferStart;
 | 
					    unsigned char *bufferStart;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3507,16 +3506,20 @@ ProcGetFontPath(ClientPtr client)
 | 
				
			||||||
    if (rc != Success)
 | 
					    if (rc != Success)
 | 
				
			||||||
        return rc;
 | 
					        return rc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    reply = (xGetFontPathReply) {
 | 
					    xGetFontPathReply rep = {
 | 
				
			||||||
        .type = X_Reply,
 | 
					        .type = X_Reply,
 | 
				
			||||||
        .sequenceNumber = client->sequence,
 | 
					        .sequenceNumber = client->sequence,
 | 
				
			||||||
        .length = bytes_to_int32(stringLens + numpaths),
 | 
					        .length = bytes_to_int32(stringLens + numpaths),
 | 
				
			||||||
        .nPaths = numpaths
 | 
					        .nPaths = numpaths
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply);
 | 
					    if (client->swapped) {
 | 
				
			||||||
    if (stringLens || numpaths)
 | 
					        swaps(&rep.sequenceNumber);
 | 
				
			||||||
        WriteToClient(client, stringLens + numpaths, bufferStart);
 | 
					        swapl(&rep.length);
 | 
				
			||||||
 | 
					        swaps(&rep.nPaths);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    WriteToClient(client, sizeof(rep), &rep);
 | 
				
			||||||
 | 
					    WriteToClient(client, stringLens + numpaths, bufferStart);
 | 
				
			||||||
    return Success;
 | 
					    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
 | 
					void _X_COLD
 | 
				
			||||||
SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
 | 
					SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -765,7 +765,7 @@ ReplySwapPtr ReplySwapVector[256] = {
 | 
				
			||||||
    ReplyNotSwappd,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    ReplyNotSwappd,                             /* 50 */
 | 
					    ReplyNotSwappd,                             /* 50 */
 | 
				
			||||||
    ReplyNotSwappd,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    (ReplySwapPtr) SGetFontPathReply,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    ReplyNotSwappd,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    ReplyNotSwappd,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    ReplyNotSwappd,                             /* 55 */
 | 
					    ReplyNotSwappd,                             /* 55 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,10 +64,6 @@ extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
 | 
				
			||||||
                                int /* size */ ,
 | 
					                                int /* size */ ,
 | 
				
			||||||
                                xGetInputFocusReply * /* pRep */ );
 | 
					                                xGetInputFocusReply * /* pRep */ );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern void SGetFontPathReply(ClientPtr /* pClient */ ,
 | 
					 | 
				
			||||||
                              int /* size */ ,
 | 
					 | 
				
			||||||
                              xGetFontPathReply * /* pRep */ );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
extern void SListExtensionsReply(ClientPtr /* pClient */ ,
 | 
					extern void SListExtensionsReply(ClientPtr /* pClient */ ,
 | 
				
			||||||
                                 int /* size */ ,
 | 
					                                 int /* size */ ,
 | 
				
			||||||
                                 xListExtensionsReply * /* pRep */ );
 | 
					                                 xListExtensionsReply * /* pRep */ );
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue