Revert "randr: ProcRRGetOutputProperty(): use SwapShort()/SwapLong()"

This reverts commit 8789be52a4.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2012>
This commit is contained in:
Alan Coopersmith 2025-06-11 13:41:13 -07:00
parent 3a76d12ef0
commit 01914b1c53

View File

@ -727,25 +727,23 @@ ProcRRGetOutputProperty(ClientPtr client)
swapl(&rep.bytesAfter); swapl(&rep.bytesAfter);
swapl(&rep.nItems); swapl(&rep.nItems);
} }
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 (rep.format) { switch (rep.format) {
case 32: case 32:
if (client->swapped) client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
SwapLongs((CARD32*)extra, len / sizeof(CARD32));
break; break;
case 16: case 16:
if (client->swapped) client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write;
SwapShorts((short*)extra, len / sizeof(CARD16));
break; break;
default: default:
client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient;
break; break;
} }
} WriteSwappedDataToClient(client, len, extra);
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, len, extra);
free(extra); free(extra);
}
if (stuff->delete && (rep.bytesAfter == 0)) { /* delete the Property */ if (stuff->delete && (rep.bytesAfter == 0)) { /* delete the Property */
*prev = prop->next; *prev = prop->next;