damage: use REPLY_*() macros for preparing / sending replies

Use the new macros for preparing and sending replies to clients.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-07-09 11:57:20 +02:00
parent 52bf89e19f
commit 8ca929a021

View File

@ -187,10 +187,7 @@ ProcDamageQueryVersion(ClientPtr client)
REQUEST_FIELD_CARD32(minorVersion); REQUEST_FIELD_CARD32(minorVersion);
DamageClientPtr pDamageClient = GetDamageClient(client); DamageClientPtr pDamageClient = GetDamageClient(client);
xDamageQueryVersionReply rep = { xDamageQueryVersionReply rep = { 0 };
.type = X_Reply,
.sequenceNumber = client->sequence,
};
if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) { if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) {
rep.majorVersion = stuff->majorVersion; rep.majorVersion = stuff->majorVersion;
@ -206,14 +203,10 @@ ProcDamageQueryVersion(ClientPtr client)
} }
pDamageClient->major_version = rep.majorVersion; pDamageClient->major_version = rep.majorVersion;
pDamageClient->minor_version = rep.minorVersion; pDamageClient->minor_version = rep.minorVersion;
if (client->swapped) {
swaps(&rep.sequenceNumber); REPLY_FIELD_CARD32(majorVersion);
swapl(&rep.length); REPLY_FIELD_CARD32(minorVersion);
swapl(&rep.majorVersion); REPLY_SEND_RET_SUCCESS();
swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xDamageQueryVersionReply), &rep);
return Success;
} }
static void static void