dix: write out X_QueryFont 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
							
								
									9136207164
								
							
						
					
					
						commit
						83569a31c8
					
				| 
						 | 
					@ -1362,7 +1362,11 @@ ProcQueryFont(ClientPtr client)
 | 
				
			||||||
        reply->sequenceNumber = client->sequence;
 | 
					        reply->sequenceNumber = client->sequence;
 | 
				
			||||||
        QueryFont(pFont, reply, nprotoxcistructs);
 | 
					        QueryFont(pFont, reply, nprotoxcistructs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        WriteReplyToClient(client, rlength, reply);
 | 
					        if (client->swapped) {
 | 
				
			||||||
 | 
					            SwapFont(reply, TRUE);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        WriteToClient(client, rlength, reply);
 | 
				
			||||||
        free(reply);
 | 
					        free(reply);
 | 
				
			||||||
        return Success;
 | 
					        return Success;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -59,8 +59,6 @@ static void SwapFontInfo(xQueryFontReply * pr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void SwapCharInfo(xCharInfo * pInfo);
 | 
					static void SwapCharInfo(xCharInfo * pInfo);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void SwapFont(xQueryFontReply * pr, Bool hasGlyphs);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Thanks to Jack Palevich for testing and subsequently rewriting all this
 | 
					 * Thanks to Jack Palevich for testing and subsequently rewriting all this
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
| 
						 | 
					@ -274,7 +272,7 @@ SwapFontInfo(xQueryFontReply * pr)
 | 
				
			||||||
    swapl(&pr->nCharInfos);
 | 
					    swapl(&pr->nCharInfos);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void _X_COLD
 | 
					void _X_COLD
 | 
				
			||||||
SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
 | 
					SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    unsigned i;
 | 
					    unsigned i;
 | 
				
			||||||
| 
						 | 
					@ -303,13 +301,6 @@ SwapFont(xQueryFontReply * pr, Bool hasGlyphs)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void _X_COLD
 | 
					 | 
				
			||||||
SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    SwapFont(pRep, TRUE);
 | 
					 | 
				
			||||||
    WriteToClient(pClient, size, pRep);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void _X_COLD
 | 
					void _X_COLD
 | 
				
			||||||
SQueryTextExtentsReply(ClientPtr pClient, int size,
 | 
					SQueryTextExtentsReply(ClientPtr pClient, int size,
 | 
				
			||||||
                       xQueryTextExtentsReply * pRep)
 | 
					                       xQueryTextExtentsReply * pRep)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -762,7 +762,7 @@ ReplySwapPtr ReplySwapVector[256] = {
 | 
				
			||||||
    ReplyNotSwappd,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    ReplyNotSwappd,                             /* 45 */
 | 
					    ReplyNotSwappd,                             /* 45 */
 | 
				
			||||||
    ReplyNotSwappd,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    (ReplySwapPtr) SQueryFontReply,
 | 
					    ReplyNotSwappd,
 | 
				
			||||||
    (ReplySwapPtr) SQueryTextExtentsReply,
 | 
					    (ReplySwapPtr) SQueryTextExtentsReply,
 | 
				
			||||||
    (ReplySwapPtr) SListFontsReply,
 | 
					    (ReplySwapPtr) SListFontsReply,
 | 
				
			||||||
    (ReplySwapPtr) SListFontsWithInfoReply,     /* 50 */
 | 
					    (ReplySwapPtr) SListFontsWithInfoReply,     /* 50 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,6 +26,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 | 
				
			||||||
#ifndef SWAPREP_H
 | 
					#ifndef SWAPREP_H
 | 
				
			||||||
#define SWAPREP_H 1
 | 
					#define SWAPREP_H 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void SwapFont(xQueryFontReply * pr, Bool hasGlyphs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern void Swap32Write(ClientPtr /* pClient */ ,
 | 
					extern void Swap32Write(ClientPtr /* pClient */ ,
 | 
				
			||||||
                        int /* size */ ,
 | 
					                        int /* size */ ,
 | 
				
			||||||
                        CARD32 * /* pbuf */ );
 | 
					                        CARD32 * /* pbuf */ );
 | 
				
			||||||
| 
						 | 
					@ -62,10 +64,6 @@ extern void SGetInputFocusReply(ClientPtr /* pClient */ ,
 | 
				
			||||||
                                int /* size */ ,
 | 
					                                int /* size */ ,
 | 
				
			||||||
                                xGetInputFocusReply * /* pRep */ );
 | 
					                                xGetInputFocusReply * /* pRep */ );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern void SQueryFontReply(ClientPtr /* pClient */ ,
 | 
					 | 
				
			||||||
                            int /* size */ ,
 | 
					 | 
				
			||||||
                            xQueryFontReply * /* pRep */ );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
extern void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
 | 
					extern void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
 | 
				
			||||||
                                   int /* size */ ,
 | 
					                                   int /* size */ ,
 | 
				
			||||||
                                   xQueryTextExtentsReply *     /* pRep */
 | 
					                                   xQueryTextExtentsReply *     /* pRep */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue