summaryrefslogtreecommitdiff
path: root/randr/rrcrtc.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
commitbd6f948c41865c2c9d3fba1000bf5f7458d3afc1 (patch)
treee2560b521406b16c9ecc87602845991d27e35073 /randr/rrcrtc.c
parenta406bd07593edb69285cf2fd91a6af4a5d956817 (diff)
Use C99 designated initializers in randr 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 'randr/rrcrtc.c')
-rw-r--r--randr/rrcrtc.c69
1 files changed, 40 insertions, 29 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index c91c7fdf9..138fbe16f 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -900,11 +900,13 @@ ProcRRGetCrtcInfo(ClientPtr client)
mode = crtc->mode;
- rep.type = X_Reply;
- rep.status = RRSetConfigSuccess;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+ rep = (xRRGetCrtcInfoReply) {
+ .type = X_Reply,
+ .status = RRSetConfigSuccess,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .timestamp = pScrPriv->lastSetTime.milliseconds
+ };
if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) &&
(panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1))
@@ -1171,11 +1173,13 @@ ProcRRSetCrtcConfig(ClientPtr client)
sendReply:
free(outputs);
- rep.type = X_Reply;
- rep.status = status;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
+ rep = (xRRSetCrtcConfigReply) {
+ .type = X_Reply,
+ .status = status,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .newTimestamp = pScrPriv->lastSetTime.milliseconds
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -1211,12 +1215,13 @@ ProcRRGetPanning(ClientPtr client)
if (!pScrPriv)
return RRErrorBase + BadRRCrtc;
- memset(&rep, 0, sizeof(rep));
- rep.type = X_Reply;
- rep.status = RRSetConfigSuccess;
- rep.sequenceNumber = client->sequence;
- rep.length = 1;
- rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+ rep = (xRRGetPanningReply) {
+ .type = X_Reply,
+ .status = RRSetConfigSuccess,
+ .sequenceNumber = client->sequence,
+ .length = 1,
+ .timestamp = pScrPriv->lastSetTime.milliseconds
+ };
if (pScrPriv->rrGetPanning &&
pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) {
@@ -1310,11 +1315,13 @@ ProcRRSetPanning(ClientPtr client)
status = RRSetConfigSuccess;
sendReply:
- rep.type = X_Reply;
- rep.status = status;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
+ rep = (xRRSetPanningReply) {
+ .type = X_Reply,
+ .status = status,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .newTimestamp = pScrPriv->lastSetTime.milliseconds
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -1339,10 +1346,12 @@ ProcRRGetCrtcGammaSize(ClientPtr client)
if (!RRCrtcGammaGet(crtc))
return RRErrorBase + BadRRCrtc;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = 0;
- reply.size = crtc->gammaSize;
+ reply = (xRRGetCrtcGammaSizeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .size = crtc->gammaSize
+ };
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);
@@ -1376,10 +1385,12 @@ ProcRRGetCrtcGamma(ClientPtr client)
return BadAlloc;
}
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = bytes_to_int32(len);
- reply.size = crtc->gammaSize;
+ reply = (xRRGetCrtcGammaReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(len),
+ .size = crtc->gammaSize
+ };
if (client->swapped) {
swaps(&reply.sequenceNumber);
swapl(&reply.length);