diff options
Diffstat (limited to 'xorg-server/record')
-rw-r--r-- | xorg-server/record/record.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/xorg-server/record/record.c b/xorg-server/record/record.c index 8a38118cd..f728cc684 100644 --- a/xorg-server/record/record.c +++ b/xorg-server/record/record.c @@ -38,6 +38,7 @@ and Jim Haggerty of Metheus. #include "dixstruct.h" #include "extnsionst.h" +#include "extinit.h" #include <X11/extensions/recordproto.h> #include "set.h" #include "swaprep.h" @@ -139,8 +140,6 @@ static int RecordDeleteContext(pointer /*value */ , XID /*id */ ); -void RecordExtensionInit(void); - /***************************************************************************/ /* client private stuff */ @@ -241,12 +240,12 @@ RecordFlushReplyBuffer(RecordContextPtr pContext, ++pContext->inFlush; if (pContext->numBufBytes) WriteToClient(pContext->pRecordingClient, pContext->numBufBytes, - (char *) pContext->replyBuffer); + pContext->replyBuffer); pContext->numBufBytes = 0; if (len1) - WriteToClient(pContext->pRecordingClient, len1, (char *) data1); + WriteToClient(pContext->pRecordingClient, len1, data1); if (len2) - WriteToClient(pContext->pRecordingClient, len2, (char *) data2); + WriteToClient(pContext->pRecordingClient, len2, data2); --pContext->inFlush; } /* RecordFlushReplyBuffer */ @@ -1829,8 +1828,7 @@ ProcRecordQueryVersion(ClientPtr client) swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - (void) WriteToClient(client, sizeof(xRecordQueryVersionReply), - (char *) &rep); + WriteToClient(client, sizeof(xRecordQueryVersionReply), &rep); return Success; } /* ProcRecordQueryVersion */ @@ -2136,6 +2134,7 @@ ProcRecordGetContext(ClientPtr client) GetContextRangeInfoPtr pri; int i; int err; + CARD32 nClients, length; REQUEST_SIZE_MATCH(xRecordGetContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); @@ -2219,28 +2218,32 @@ ProcRecordGetContext(ClientPtr client) /* calculate number of clients and reply length */ - rep.nClients = 0; - rep.length = 0; + nClients = 0; + length = 0; for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo; pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) { - rep.nClients += pRCAP->numClients; - rep.length += pRCAP->numClients * + nClients += pRCAP->numClients; + length += pRCAP->numClients * (bytes_to_int32(sizeof(xRecordClientInfo)) + pri->nRanges * bytes_to_int32(sizeof(xRecordRange))); } /* write the reply header */ + rep.type = X_Reply; - rep.sequenceNumber = client->sequence; rep.enabled = pContext->pRecordingClient != NULL; + rep.sequenceNumber = client->sequence; + rep.length = length; rep.elementHeader = pContext->elemHeaders; + rep.nClients = nClients; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.nClients); } - (void) WriteToClient(client, sizeof(xRecordGetContextReply), (char *) &rep); + WriteToClient(client, sizeof(xRecordGetContextReply), &rep); /* write all the CLIENT_INFOs */ @@ -2257,9 +2260,9 @@ ProcRecordGetContext(ClientPtr client) rci.clientResource = pRCAP->pClientIDs[i]; if (client->swapped) swapl(&rci.clientResource); - WriteToClient(client, sizeof(xRecordClientInfo), (char *) &rci); + WriteToClient(client, sizeof(xRecordClientInfo), &rci); WriteToClient(client, sizeof(xRecordRange) * pri->nRanges, - (char *) pri->pRanges); + pri->pRanges); } } err = Success; |