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

This reverts commit 62b8497999.

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

View File

@ -685,26 +685,24 @@ ProcRRGetProviderProperty(ClientPtr client)
swapl(&reply.bytesAfter); swapl(&reply.bytesAfter);
swapl(&reply.nItems); swapl(&reply.nItems);
} }
WriteToClient(client, sizeof(xGenericReply), &reply);
if (len) { if (len) {
memcpy(extra, (char *) prop_value->data + ind, len); memcpy(extra, (char *) prop_value->data + ind, len);
switch (reply.format) { switch (reply.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);
free(extra);
} }
WriteToClient(client, sizeof(xGenericReply), &reply);
WriteToClient(client, len, extra);
free(extra);
if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */
*prev = prop->next; *prev = prop->next;
RRDestroyProviderProperty(prop); RRDestroyProviderProperty(prop);