summaryrefslogtreecommitdiff
path: root/Xext/dpms.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/dpms.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/dpms.c')
-rw-r--r--Xext/dpms.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/Xext/dpms.c b/Xext/dpms.c
index 35be966c6..8ec32eac2 100644
--- a/Xext/dpms.c
+++ b/Xext/dpms.c
@@ -45,15 +45,16 @@ static int
ProcDPMSGetVersion(ClientPtr client)
{
/* REQUEST(xDPMSGetVersionReq); */
- xDPMSGetVersionReply rep;
+ xDPMSGetVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = DPMSMajorVersion,
+ .minorVersion = DPMSMinorVersion
+ };
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = DPMSMajorVersion;
- rep.minorVersion = DPMSMinorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion);
@@ -67,15 +68,15 @@ static int
ProcDPMSCapable(ClientPtr client)
{
/* REQUEST(xDPMSCapableReq); */
- xDPMSCapableReply rep;
+ xDPMSCapableReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .capable = DPMSCapableFlag
+ };
REQUEST_SIZE_MATCH(xDPMSCapableReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.capable = DPMSCapableFlag;
-
if (client->swapped) {
swaps(&rep.sequenceNumber);
}
@@ -87,17 +88,17 @@ static int
ProcDPMSGetTimeouts(ClientPtr client)
{
/* REQUEST(xDPMSGetTimeoutsReq); */
- xDPMSGetTimeoutsReply rep;
+ xDPMSGetTimeoutsReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .standby = DPMSStandbyTime / MILLI_PER_SECOND,
+ .suspend = DPMSSuspendTime / MILLI_PER_SECOND,
+ .off = DPMSOffTime / MILLI_PER_SECOND
+ };
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.standby = DPMSStandbyTime / MILLI_PER_SECOND;
- rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND;
- rep.off = DPMSOffTime / MILLI_PER_SECOND;
-
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.standby);
@@ -188,16 +189,16 @@ static int
ProcDPMSInfo(ClientPtr client)
{
/* REQUEST(xDPMSInfoReq); */
- xDPMSInfoReply rep;
+ xDPMSInfoReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .power_level = DPMSPowerLevel,
+ .state = DPMSEnabled
+ };
REQUEST_SIZE_MATCH(xDPMSInfoReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.power_level = DPMSPowerLevel;
- rep.state = DPMSEnabled;
-
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.power_level);