From 6a721e3af5e11bae1d59ca551a02470f35d9e844 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 9 Jul 2012 19:12:43 -0700 Subject: Use C99 designated initializers in Xext Replies Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone --- Xext/xtest.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'Xext/xtest.c') diff --git a/Xext/xtest.c b/Xext/xtest.c index 6112c0b7d..c7b087bdf 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -88,14 +88,16 @@ static int XTestSwapFakeInput(ClientPtr /* client */ , static int ProcXTestGetVersion(ClientPtr client) { - xXTestGetVersionReply rep; + xXTestGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = XTestMajorVersion, + .minorVersion = XTestMinorVersion + }; REQUEST_SIZE_MATCH(xXTestGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = XTestMajorVersion; - rep.minorVersion = XTestMinorVersion; + if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.minorVersion); @@ -134,10 +136,12 @@ ProcXTestCompareCursor(ClientPtr client) return rc; } } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.same = (wCursor(pWin) == pCursor); + rep = (xXTestCompareCursorReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .same = (wCursor(pWin) == pCursor) + }; if (client->swapped) { swaps(&rep.sequenceNumber); } -- cgit v1.2.3