From c6b6a8fcb75023b89ec1d4b9f3ce3c9eb44764e1 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 28 Feb 2019 23:13:49 +0100 Subject: Use C99 designated initializers in various extension Replies commit cc5f09c86f7bea23b7546c3491b2c52ce8100a71 Author: Alan Coopersmith Date: Mon Jul 9 19:12:43 2012 -0700 Use C99 designated initializers in various extension Replies Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone Attributes ArcticaProject/nx-libs#382 --- nx-X11/programs/Xserver/dbe/dbe.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'nx-X11/programs/Xserver/dbe') diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 588dd0582..446571311 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -312,16 +312,16 @@ static int ProcDbeGetVersion(ClientPtr client) { /* REQUEST(xDbeGetVersionReq); */ - xDbeGetVersionReply rep; + xDbeGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = DBE_MAJOR_VERSION, + .minorVersion = DBE_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xDbeGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = DBE_MAJOR_VERSION; - rep.minorVersion = DBE_MINOR_VERSION; - if (client->swapped) { swaps(&rep.sequenceNumber); @@ -946,10 +946,12 @@ ProcDbeGetVisualInfo(ClientPtr client) length += pScrVisInfo[i].count * sizeof(xDbeVisInfo); } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = length >> 2; - rep.m = count; + rep = (xDbeGetVisualInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = length >> 2, + .m = count + }; if (client->swapped) { @@ -1041,7 +1043,11 @@ static int ProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); - xDbeGetBackBufferAttributesReply rep; + xDbeGetBackBufferAttributesReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DbeWindowPrivPtr pDbeWindowPriv; REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq); @@ -1056,10 +1062,6 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) rep.attributes = pDbeWindowPriv->pWindow->drawable.id; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - if (client->swapped) { swaps(&rep.sequenceNumber); -- cgit v1.2.3