xext: dpms: use X_SEND_REPLY_SIMPLE()

Use X_SEND_REPLY_SIMPLE() for sending out simple replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-21 18:39:24 +02:00
committed by Enrico Weigelt
parent 104a7f6b4c
commit 4a286358f4

View File

@@ -32,6 +32,7 @@ Equipment Corporation.
#include <X11/Xproto.h>
#include <X11/extensions/dpmsproto.h>
#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;
}