From 757f6ab8bcdf909819f7e6bd1e25414aa2c18dcf Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 8 Jul 2024 17:57:03 +0200 Subject: [PATCH] Xext: xtest: use REPLY_*() macros for preparing / sending replies Use the new macros for preparing and sending replies to clients. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/xtest.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/Xext/xtest.c b/Xext/xtest.c index f408d40b9..7663cf76f 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -94,21 +94,12 @@ ProcXTestGetVersion(ClientPtr client) REQUEST_FIELD_CARD16(minorVersion); xXTestGetVersionReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, .majorVersion = XTestMajorVersion, .minorVersion = XTestMinorVersion }; - REQUEST_SIZE_MATCH(xXTestGetVersionReq); - - if (client->swapped) { - swaps(&rep.sequenceNumber); - swaps(&rep.minorVersion); - } - WriteToClient(client, sizeof(xXTestGetVersionReply), &rep); - return Success; + REPLY_FIELD_CARD16(minorVersion); + REPLY_SEND_RET_SUCCESS(); } static int @@ -118,7 +109,6 @@ ProcXTestCompareCursor(ClientPtr client) REQUEST_FIELD_CARD32(window); REQUEST_FIELD_CARD32(cursor); - xXTestCompareCursorReply rep; WindowPtr pWin; CursorPtr pCursor; int rc; @@ -143,17 +133,11 @@ ProcXTestCompareCursor(ClientPtr client) return rc; } } - rep = (xXTestCompareCursorReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, + + xXTestCompareCursorReply rep = { .same = (wCursor(pWin) == pCursor) }; - if (client->swapped) { - swaps(&rep.sequenceNumber); - } - WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep); - return Success; + REPLY_SEND_RET_SUCCESS(); } void