From 1d9c412683edd196d391f0527e5ecd6071db1090 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 17 Jul 2024 19:32:30 +0200 Subject: [PATCH] Xext: panoramiX: ProcXineramaQueryScreens(): reply payload in one block Simplify writing reply payload into just one block. This also makes further simplifications by subsequent patches easier. Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/panoramiX.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 2c8f31740..966754325 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -1067,23 +1067,23 @@ ProcXineramaQueryScreens(ClientPtr client) WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep); if (!noPanoramiXExtension) { - xXineramaScreenInfo scratch; + xXineramaScreenInfo scratch[number]; // upper bound limited, number of screens int i; FOR_NSCREENS_BACKWARD(i) { - scratch.x_org = screenInfo.screens[i]->x; - scratch.y_org = screenInfo.screens[i]->y; - scratch.width = screenInfo.screens[i]->width; - scratch.height = screenInfo.screens[i]->height; + scratch[i].x_org = screenInfo.screens[i]->x; + scratch[i].y_org = screenInfo.screens[i]->y; + scratch[i].width = screenInfo.screens[i]->width; + scratch[i].height = screenInfo.screens[i]->height; if (client->swapped) { - swaps(&scratch.x_org); - swaps(&scratch.y_org); - swaps(&scratch.width); - swaps(&scratch.height); + swaps(&scratch[i].x_org); + swaps(&scratch[i].y_org); + swaps(&scratch[i].width); + swaps(&scratch[i].height); } - WriteToClient(client, sz_XineramaScreenInfo, &scratch); } + WriteToClient(client, sizeof(scratch), &scratch); } return Success;