summaryrefslogtreecommitdiff
path: root/Xext/xcmisc.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:43 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:58:30 -0700
commit6a721e3af5e11bae1d59ca551a02470f35d9e844 (patch)
treeb95dd0d69fca66321f010959e69c44f781452c1f /Xext/xcmisc.c
parentd792ac125a0462a04a930af543cbc732f8cdab7d (diff)
Use C99 designated initializers in Xext Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'Xext/xcmisc.c')
-rw-r--r--Xext/xcmisc.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c
index 943b424c0..9e4ea896e 100644
--- a/Xext/xcmisc.c
+++ b/Xext/xcmisc.c
@@ -45,14 +45,16 @@ from The Open Group.
static int
ProcXCMiscGetVersion(ClientPtr client)
{
- xXCMiscGetVersionReply rep;
+ xXCMiscGetVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = XCMiscMajorVersion,
+ .minorVersion = XCMiscMinorVersion
+ };
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XCMiscMajorVersion;
- rep.minorVersion = XCMiscMinorVersion;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion);
@@ -70,11 +72,13 @@ ProcXCMiscGetXIDRange(ClientPtr client)
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
GetXIDRange(client->index, FALSE, &min_id, &max_id);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.start_id = min_id;
- rep.count = max_id - min_id + 1;
+ rep = (xXCMiscGetXIDRangeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .start_id = min_id,
+ .count = max_id - min_id + 1
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.start_id);
@@ -102,10 +106,12 @@ ProcXCMiscGetXIDList(ClientPtr client)
return BadAlloc;
}
count = GetXIDList(client, stuff->count, pids);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = count;
- rep.count = count;
+ rep = (xXCMiscGetXIDListReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = count,
+ .count = count
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);