mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
glx: glxcmds: use rpcbuf to build xGLXGetDrawableAttributesReply payload
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
This commit is contained in:
@@ -1886,28 +1886,17 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
|
||||
#undef ATTRIB
|
||||
|
||||
xGLXGetDrawableAttributesReply reply = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = num << 1,
|
||||
.numAttribs = num
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
int length = reply.length;
|
||||
|
||||
swaps(&reply.sequenceNumber);
|
||||
swapl(&reply.length);
|
||||
swapl(&reply.numAttribs);
|
||||
WriteToClient(client, sizeof(xGLXGetDrawableAttributesReply), &reply);
|
||||
SwapLongs(attributes, length);
|
||||
WriteToClient(client, length << 2, attributes);
|
||||
}
|
||||
else {
|
||||
WriteToClient(client, sizeof(xGLXGetDrawableAttributesReply), &reply);
|
||||
WriteToClient(client, reply.length * sizeof(CARD32), attributes);
|
||||
}
|
||||
|
||||
return Success;
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
x_rpcbuf_write_CARD32s(&rpcbuf, attributes, num << 1);
|
||||
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user