dix: write out X_ListFontsWithInfo 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
712febb9b4
commit
189f475093
|
@ -59,6 +59,7 @@ Equipment Corporation.
|
|||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/gc_priv.h"
|
||||
#include "include/swaprep.h"
|
||||
#include "os/auth.h"
|
||||
|
||||
#include "scrnintstr.h"
|
||||
|
@ -862,7 +863,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
xFontProp *pFP;
|
||||
int i;
|
||||
int aliascount = 0;
|
||||
xListFontsWithInfoReply finalReply;
|
||||
|
||||
if (client->clientGone) {
|
||||
if (c->current.current_fpe < c->num_fpes) {
|
||||
|
@ -872,7 +872,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
err = Successful;
|
||||
goto bail;
|
||||
}
|
||||
client->pSwapReplyFunc = ReplySwapVector[X_ListFontsWithInfo];
|
||||
if (!c->current.patlen)
|
||||
goto finish;
|
||||
while (c->current.current_fpe < c->num_fpes) {
|
||||
|
@ -1014,7 +1013,10 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
pFP->value = pFontInfo->props[i].value;
|
||||
pFP++;
|
||||
}
|
||||
WriteSwappedDataToClient(client, length, reply);
|
||||
if (client->swapped) {
|
||||
SwapFont((xQueryFontReply *) reply, FALSE);
|
||||
}
|
||||
WriteToClient(client, length, reply);
|
||||
WriteToClient(client, namelen, name);
|
||||
if (pFontInfo == &fontInfo) {
|
||||
free(fontInfo.props);
|
||||
|
@ -1025,13 +1027,16 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
}
|
||||
finish:
|
||||
length = sizeof(xListFontsWithInfoReply);
|
||||
finalReply = (xListFontsWithInfoReply) {
|
||||
xListFontsWithInfoReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
|
||||
- sizeof(xGenericReply))
|
||||
};
|
||||
WriteSwappedDataToClient(client, length, &finalReply);
|
||||
if (client->swapped) {
|
||||
SwapFont((xQueryFontReply *) &rep, FALSE);
|
||||
}
|
||||
WriteToClient(client, length, &rep);
|
||||
bail:
|
||||
ClientWakeup(client);
|
||||
for (i = 0; i < c->num_fpes; i++)
|
||||
|
|
|
@ -316,14 +316,6 @@ SQueryTextExtentsReply(ClientPtr pClient, int size,
|
|||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SListFontsWithInfoReply(ClientPtr pClient, int size,
|
||||
xListFontsWithInfoReply * pRep)
|
||||
{
|
||||
SwapFont((xQueryFontReply *) pRep, FALSE);
|
||||
WriteToClient(pClient, size, pRep);
|
||||
}
|
||||
|
||||
void _X_COLD
|
||||
SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep)
|
||||
{
|
||||
|
|
|
@ -765,7 +765,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
|||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SQueryTextExtentsReply,
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SListFontsWithInfoReply, /* 50 */
|
||||
ReplyNotSwappd, /* 50 */
|
||||
ReplyNotSwappd,
|
||||
(ReplySwapPtr) SGetFontPathReply,
|
||||
ReplyNotSwappd,
|
||||
|
|
|
@ -69,11 +69,6 @@ extern void SQueryTextExtentsReply(ClientPtr /* pClient */ ,
|
|||
xQueryTextExtentsReply * /* pRep */
|
||||
);
|
||||
|
||||
extern void SListFontsWithInfoReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xListFontsWithInfoReply *
|
||||
/* pRep */ );
|
||||
|
||||
extern void SGetFontPathReply(ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
xGetFontPathReply * /* pRep */ );
|
||||
|
|
Loading…
Reference in New Issue