diff --git a/Xext/dpms.c b/Xext/dpms.c index 6b1645953..8a735eeea 100644 --- a/Xext/dpms.c +++ b/Xext/dpms.c @@ -32,6 +32,7 @@ Equipment Corporation. #include #include +#include "dix/dix_priv.h" #include "miext/extinit_priv.h" #include "os/screensaver.h" #include "Xext/geext_priv.h" @@ -305,9 +306,6 @@ ProcDPMSGetVersion(ClientPtr client) { /* REQUEST(xDPMSGetVersionReq); */ xDPMSGetVersionReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, .majorVersion = SERVER_DPMS_MAJOR_VERSION, .minorVersion = SERVER_DPMS_MINOR_VERSION }; @@ -315,11 +313,10 @@ ProcDPMSGetVersion(ClientPtr client) REQUEST_SIZE_MATCH(xDPMSGetVersionReq); if (client->swapped) { - swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep); + X_SEND_REPLY_SIMPLE(client, rep); return Success; } @@ -328,18 +325,12 @@ ProcDPMSCapable(ClientPtr client) { /* REQUEST(xDPMSCapableReq); */ xDPMSCapableReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, .capable = TRUE }; REQUEST_SIZE_MATCH(xDPMSCapableReq); - if (client->swapped) { - swaps(&rep.sequenceNumber); - } - WriteToClient(client, sizeof(xDPMSCapableReply), &rep); + X_SEND_REPLY_SIMPLE(client, rep); return Success; } @@ -348,9 +339,6 @@ ProcDPMSGetTimeouts(ClientPtr client) { /* REQUEST(xDPMSGetTimeoutsReq); */ 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 @@ -359,12 +347,11 @@ ProcDPMSGetTimeouts(ClientPtr client) REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); if (client->swapped) { - swaps(&rep.sequenceNumber); swaps(&rep.standby); swaps(&rep.suspend); swaps(&rep.off); } - WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep); + X_SEND_REPLY_SIMPLE(client, rep); return Success; } @@ -453,9 +440,6 @@ ProcDPMSInfo(ClientPtr client) { /* REQUEST(xDPMSInfoReq); */ xDPMSInfoReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, .power_level = DPMSPowerLevel, .state = DPMSEnabled }; @@ -463,10 +447,9 @@ ProcDPMSInfo(ClientPtr client) REQUEST_SIZE_MATCH(xDPMSInfoReq); if (client->swapped) { - swaps(&rep.sequenceNumber); swaps(&rep.power_level); } - WriteToClient(client, sizeof(xDPMSInfoReply), &rep); + X_SEND_REPLY_SIMPLE(client, rep); return Success; }