randr: ProcRRGetOutputProperty(): rename reply struct to "rep"

Harmonize it with all the other reply struct fields, so we can later
use generic macros for final preparation and writeout.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1794>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-07-29 19:06:40 +02:00 committed by Marge Bot
parent 05188ccec1
commit 53d43bd8dc

View File

@ -643,16 +643,16 @@ ProcRRGetOutputProperty(ClientPtr client)
if (prop->propertyName == stuff->property) if (prop->propertyName == stuff->property)
break; break;
xRRGetOutputPropertyReply reply = { xRRGetOutputPropertyReply rep = {
.type = X_Reply, .type = X_Reply,
.sequenceNumber = client->sequence .sequenceNumber = client->sequence
}; };
if (!prop) { if (!prop) {
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber); swaps(&rep.sequenceNumber);
} }
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); WriteToClient(client, sizeof(rep), &rep);
return Success; return Success;
} }
@ -668,15 +668,15 @@ ProcRRGetOutputProperty(ClientPtr client)
if (((stuff->type != prop_value->type) && (stuff->type != AnyPropertyType)) if (((stuff->type != prop_value->type) && (stuff->type != AnyPropertyType))
) { ) {
reply.bytesAfter = prop_value->size; rep.bytesAfter = prop_value->size;
reply.format = prop_value->format; rep.format = prop_value->format;
reply.propertyType = prop_value->type; rep.propertyType = prop_value->type;
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&reply.propertyType); swapl(&rep.propertyType);
swapl(&reply.bytesAfter); swapl(&rep.bytesAfter);
} }
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply); WriteToClient(client, sizeof(rep), &rep);
return Success; return Success;
} }
@ -701,14 +701,14 @@ ProcRRGetOutputProperty(ClientPtr client)
if (!extra) if (!extra)
return BadAlloc; return BadAlloc;
} }
reply.bytesAfter = n - (ind + len); rep.bytesAfter = n - (ind + len);
reply.format = prop_value->format; rep.format = prop_value->format;
reply.length = bytes_to_int32(len); rep.length = bytes_to_int32(len);
if (prop_value->format) if (prop_value->format)
reply.nItems = len / (prop_value->format / 8); rep.nItems = len / (prop_value->format / 8);
reply.propertyType = prop_value->type; rep.propertyType = prop_value->type;
if (stuff->delete && (reply.bytesAfter == 0)) { if (stuff->delete && (rep.bytesAfter == 0)) {
xRROutputPropertyNotifyEvent event = { xRROutputPropertyNotifyEvent event = {
.type = RREventBase + RRNotify, .type = RREventBase + RRNotify,
.subCode = RRNotify_OutputProperty, .subCode = RRNotify_OutputProperty,
@ -721,16 +721,16 @@ ProcRRGetOutputProperty(ClientPtr client)
} }
if (client->swapped) { if (client->swapped) {
swaps(&reply.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&reply.length); swapl(&rep.length);
swapl(&reply.propertyType); swapl(&rep.propertyType);
swapl(&reply.bytesAfter); swapl(&rep.bytesAfter);
swapl(&reply.nItems); swapl(&rep.nItems);
} }
WriteToClient(client, sizeof(xGenericReply), &reply); WriteToClient(client, sizeof(rep), &rep);
if (len) { if (len) {
memcpy(extra, (char *) prop_value->data + ind, len); memcpy(extra, (char *) prop_value->data + ind, len);
switch (reply.format) { switch (rep.format) {
case 32: case 32:
client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
break; break;
@ -745,7 +745,7 @@ ProcRRGetOutputProperty(ClientPtr client)
free(extra); free(extra);
} }
if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ if (stuff->delete && (rep.bytesAfter == 0)) { /* delete the Property */
*prev = prop->next; *prev = prop->next;
RRDestroyOutputProperty(prop); RRDestroyOutputProperty(prop);
} }