diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:58:30 -0700 |
commit | cc5f09c86f7bea23b7546c3491b2c52ce8100a71 (patch) | |
tree | 823cbe0c7406ff270500b9e332268f5780a26650 | |
parent | 2f5caeaddb3616dc9ff57d784f7feba589c536e7 (diff) |
Use C99 designated initializers in various extension Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r-- | composite/compext.c | 29 | ||||
-rw-r--r-- | damageext/damageext.c | 10 | ||||
-rw-r--r-- | dbe/dbe.c | 34 | ||||
-rw-r--r-- | record/record.c | 27 | ||||
-rw-r--r-- | render/render.c | 10 | ||||
-rw-r--r-- | xfixes/cursor.c | 12 | ||||
-rw-r--r-- | xfixes/xfixes.c | 10 |
7 files changed, 73 insertions, 59 deletions
diff --git a/composite/compext.c b/composite/compext.c index be25b2779..eea1a5861 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -107,14 +107,15 @@ static int ProcCompositeQueryVersion(ClientPtr client) { CompositeClientPtr pCompositeClient = GetCompositeClient(client); - xCompositeQueryVersionReply rep; + xCompositeQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xCompositeQueryVersionReq); REQUEST_SIZE_MATCH(xCompositeQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; @@ -311,10 +312,12 @@ ProcCompositeGetOverlayWindow(ClientPtr client) return rc; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.overlayWin = cs->pOverlayWin->drawable.id; + rep = (xCompositeGetOverlayWindowReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .overlayWin = cs->pOverlayWin->drawable.id + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -842,10 +845,12 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client) cs = GetCompScreen(screenInfo.screens[0]); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.overlayWin = cs->pOverlayWin->drawable.id; + rep = (xCompositeGetOverlayWindowReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .overlayWin = cs->pOverlayWin->drawable.id + }; if (client->swapped) { swaps(&rep.sequenceNumber); diff --git a/damageext/damageext.c b/damageext/damageext.c index 70d2eee1e..2eddfb369 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -126,14 +126,16 @@ static int ProcDamageQueryVersion(ClientPtr client) { DamageClientPtr pDamageClient = GetDamageClient(client); - xDamageQueryVersionReply rep; + xDamageQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xDamageQueryVersionReq); REQUEST_SIZE_MATCH(xDamageQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; @@ -118,16 +118,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); } @@ -667,10 +667,12 @@ ProcDbeGetVisualInfo(ClientPtr client) length += pScrVisInfo[i].count * sizeof(xDbeVisInfo); } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = bytes_to_int32(length); - rep.m = count; + rep = (xDbeGetVisualInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(length), + .m = count + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -755,7 +757,11 @@ static int ProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); - xDbeGetBackBufferAttributesReply rep; + xDbeGetBackBufferAttributesReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DbeWindowPrivPtr pDbeWindowPriv; int rc; @@ -771,10 +777,6 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) rep.attributes = None; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); diff --git a/record/record.c b/record/record.c index 54a0e68dd..67569d90c 100644 --- a/record/record.c +++ b/record/record.c @@ -1816,14 +1816,15 @@ static int ProcRecordQueryVersion(ClientPtr client) { /* REQUEST(xRecordQueryVersionReq); */ - xRecordQueryVersionReply rep; + xRecordQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_RECORD_MAJOR_VERSION, + .minorVersion = SERVER_RECORD_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xRecordQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SERVER_RECORD_MAJOR_VERSION; - rep.minorVersion = SERVER_RECORD_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); @@ -2231,12 +2232,14 @@ ProcRecordGetContext(ClientPtr client) /* write the reply header */ - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = length; - rep.enabled = pContext->pRecordingClient != NULL; - rep.elementHeader = pContext->elemHeaders; - rep.nClients = nClients; + rep = (xRecordGetContextReply) { + .type = X_Reply, + .enabled = pContext->pRecordingClient != NULL, + .sequenceNumber = client->sequence, + .length = length, + .elementHeader = pContext->elemHeaders, + .nClients = nClients + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); diff --git a/render/render.c b/render/render.c index 3bf070268..530181197 100644 --- a/render/render.c +++ b/render/render.c @@ -267,7 +267,11 @@ static int ProcRenderQueryVersion(ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient(client); - xRenderQueryVersionReply rep; + xRenderQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xRenderQueryVersionReq); @@ -275,10 +279,6 @@ ProcRenderQueryVersion(ClientPtr client) pRenderClient->minor_version = stuff->minorVersion; REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if ((stuff->majorVersion * 1000 + stuff->minorVersion) < (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) { diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 402456db0..68f7b740d 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -474,11 +474,13 @@ ProcXFixesGetCursorName(ClientPtr client) str = ""; len = strlen(str); - reply.type = X_Reply; - reply.length = bytes_to_int32(len); - reply.sequenceNumber = client->sequence; - reply.atom = pCursor->name; - reply.nbytes = len; + reply = (xXFixesGetCursorNameReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .atom = pCursor->name, + .nbytes = len + }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index 54f84f41d..c6dd19eb3 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -61,15 +61,15 @@ static int ProcXFixesQueryVersion(ClientPtr client) { XFixesClientPtr pXFixesClient = GetXFixesClient(client); - xXFixesQueryVersionReply rep; + xXFixesQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); - memset(&rep, 0, sizeof(xXFixesQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (version_compare(stuff->majorVersion, stuff->minorVersion, SERVER_XFIXES_MAJOR_VERSION, |