diff --git a/dix/extension.c b/dix/extension.c index e603318b8..e565ac700 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -258,13 +258,12 @@ ProcQueryExtension(ClientPtr client) int ProcListExtensions(ClientPtr client) { - xListExtensionsReply reply; char *bufptr, *buffer; int total_length = 0; REQUEST_SIZE_MATCH(xReq); - reply = (xListExtensionsReply) { + xListExtensionsReply rep = { .type = X_Reply, .nExtensions = 0, .sequenceNumber = client->sequence, @@ -281,9 +280,9 @@ ProcListExtensions(ClientPtr client) continue; total_length += strlen(extensions[i]->name) + 1; - reply.nExtensions += 1; + rep.nExtensions += 1; } - reply.length = bytes_to_int32(total_length); + rep.length = bytes_to_int32(total_length); buffer = bufptr = calloc(1, total_length); if (!buffer) return BadAlloc; @@ -298,9 +297,13 @@ ProcListExtensions(ClientPtr client) bufptr += len; } } - WriteReplyToClient(client, sizeof(xListExtensionsReply), &reply); - if (reply.length) - WriteToClient(client, total_length, buffer); + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + } + WriteToClient(client, sizeof(rep), &rep); + WriteToClient(client, total_length, buffer); free(buffer); return Success; diff --git a/dix/swaprep.c b/dix/swaprep.c index bdbf69acb..f5d43968e 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -279,14 +279,6 @@ SwapFont(xQueryFontReply * pr, Bool hasGlyphs) } } -void _X_COLD -SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep) -{ - swaps(&pRep->sequenceNumber); - swapl(&pRep->length); - WriteToClient(pClient, size, pRep); -} - void _X_COLD SErrorEvent(xError * from, xError * to) { diff --git a/dix/tables.c b/dix/tables.c index f54e9bd9e..18c3dd289 100644 --- a/dix/tables.c +++ b/dix/tables.c @@ -814,7 +814,7 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - (ReplySwapPtr) SListExtensionsReply, + ReplyNotSwappd, ReplyNotSwappd, /* 100 */ ReplyNotSwappd, ReplyNotSwappd, diff --git a/include/swaprep.h b/include/swaprep.h index 55e0795b0..3981cd7c5 100644 --- a/include/swaprep.h +++ b/include/swaprep.h @@ -55,10 +55,6 @@ extern void SwapTimeCoordWrite(ClientPtr /* pClient */ , int /* size */ , xTimecoord * /* pRep */ ); -extern void SListExtensionsReply(ClientPtr /* pClient */ , - int /* size */ , - xListExtensionsReply * /* pRep */ ); - extern void SErrorEvent(xError * /* from */ , xError * /* to */ );