From 79d092cfb9a21693e71f76cc1b13316c4ce19277 Mon Sep 17 00:00:00 2001 From: sesankm <26676400+sesankm@users.noreply.github.com> Date: Tue, 23 Sep 2025 14:26:30 -0500 Subject: [PATCH] glx: glxcmds: use rpcbuf to build xGLXGetDrawableAttributesReply payload Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com> --- glx/glxcmds.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 21d446300b..106d7ca386 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -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