dix: consistenly name reply structs "reply" instead of "rep"

Preparation for future use of generic reply assembly macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-12-04 16:09:38 +01:00
committed by Enrico Weigelt
parent 6b189b7a22
commit 36503b11b7
8 changed files with 227 additions and 228 deletions

View File

@@ -1034,7 +1034,7 @@ ProcGetGeometry(ClientPtr client)
if (rc != Success)
return rc;
xGetGeometryReply rep = {
xGetGeometryReply reply = {
.root = pDraw->pScreen->root->drawable.id,
.depth = pDraw->depth,
.width = pDraw->width,
@@ -1044,21 +1044,21 @@ ProcGetGeometry(ClientPtr client)
if (WindowDrawable(pDraw->type)) {
WindowPtr pWin = (WindowPtr) pDraw;
rep.x = pWin->origin.x - wBorderWidth(pWin);
rep.y = pWin->origin.y - wBorderWidth(pWin);
rep.borderWidth = pWin->borderWidth;
reply.x = pWin->origin.x - wBorderWidth(pWin);
reply.y = pWin->origin.y - wBorderWidth(pWin);
reply.borderWidth = pWin->borderWidth;
}
if (client->swapped) {
swapl(&rep.root);
swaps(&rep.x);
swaps(&rep.y);
swaps(&rep.width);
swaps(&rep.height);
swaps(&rep.borderWidth);
swapl(&reply.root);
swaps(&reply.x);
swaps(&reply.y);
swaps(&reply.width);
swaps(&reply.height);
swaps(&reply.borderWidth);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -1087,19 +1087,19 @@ ProcQueryTree(ClientPtr client)
numChildren++;
}
xQueryTreeReply rep = {
xQueryTreeReply reply = {
.root = pWin->drawable.pScreen->root->drawable.id,
.parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None,
.nChildren = numChildren,
};
if (client->swapped) {
swapl(&rep.root);
swapl(&rep.parent);
swaps(&rep.nChildren);
swapl(&reply.root);
swapl(&reply.parent);
swaps(&reply.nChildren);
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int
@@ -1123,15 +1123,15 @@ ProcInternAtom(ClientPtr client)
if (atom == BAD_RESOURCE)
return BadAlloc;
xInternAtomReply rep = {
xInternAtomReply reply = {
.atom = atom
};
if (client->swapped) {
swapl(&rep.atom);
swapl(&reply.atom);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -1155,15 +1155,15 @@ ProcGetAtomName(ClientPtr client)
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
x_rpcbuf_write_CARD8s(&rpcbuf, (CARD8*)str, len);
xGetAtomNameReply rep = {
xGetAtomNameReply reply = {
.nameLength = len
};
if (client->swapped) {
swaps(&rep.nameLength);
swaps(&reply.nameLength);
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int
@@ -1248,17 +1248,17 @@ ProcTranslateCoords(ClientPtr client)
if (rc != Success)
return rc;
xTranslateCoordsReply rep = { 0 };
xTranslateCoordsReply reply = { 0 };
if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) {
rep.sameScreen = xFalse;
rep.child = None;
rep.dstX = rep.dstY = 0;
reply.sameScreen = xFalse;
reply.child = None;
reply.dstX = reply.dstY = 0;
}
else {
INT16 x, y;
rep.sameScreen = xTrue;
rep.child = None;
reply.sameScreen = xTrue;
reply.child = None;
/* computing absolute coordinates -- adjust to destination later */
x = pWin->drawable.x + stuff->srcX;
y = pWin->drawable.y + stuff->srcY;
@@ -1285,24 +1285,24 @@ ProcTranslateCoords(ClientPtr client)
x - pWin->drawable.x,
y - pWin->drawable.y, &box))
) {
rep.child = pWin->drawable.id;
reply.child = pWin->drawable.id;
pWin = (WindowPtr) NULL;
}
else
pWin = pWin->nextSib;
}
/* adjust to destination coordinates */
rep.dstX = x - pDst->drawable.x;
rep.dstY = y - pDst->drawable.y;
reply.dstX = x - pDst->drawable.x;
reply.dstY = y - pDst->drawable.y;
}
if (client->swapped) {
swapl(&rep.child);
swaps(&rep.dstX);
swaps(&rep.dstY);
swapl(&reply.child);
swaps(&reply.dstX);
swaps(&reply.dstY);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -1429,7 +1429,7 @@ ProcQueryTextExtents(ClientPtr client)
if (!xfont2_query_text_extents(pFont, length, (unsigned char *) &stuff[1], &info))
return BadAlloc;
xQueryTextExtentsReply rep = {
xQueryTextExtentsReply reply = {
.drawDirection = info.drawDirection,
.fontAscent = info.fontAscent,
.fontDescent = info.fontDescent,
@@ -1441,16 +1441,16 @@ ProcQueryTextExtents(ClientPtr client)
};
if (client->swapped) {
swaps(&rep.fontAscent);
swaps(&rep.fontDescent);
swaps(&rep.overallAscent);
swaps(&rep.overallDescent);
swapl(&rep.overallWidth);
swapl(&rep.overallLeft);
swapl(&rep.overallRight);
swaps(&reply.fontAscent);
swaps(&reply.fontDescent);
swaps(&reply.overallAscent);
swaps(&reply.overallDescent);
swapl(&reply.overallWidth);
swapl(&reply.overallLeft);
swapl(&reply.overallRight);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -2243,7 +2243,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
if (rc != Success)
return rc;
xGetImageReply rep = { 0 };
xGetImageReply reply = { 0 };
relx = x;
rely = y;
@@ -2278,11 +2278,11 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
pBoundingDraw = (DrawablePtr) pDraw->pScreen->root;
}
rep.visual = wVisual(pWin);
reply.visual = wVisual(pWin);
}
else {
pBoundingDraw = pDraw;
rep.visual = None;
reply.visual = None;
}
/* "If the drawable is a pixmap, the given rectangle must be wholly
@@ -2300,7 +2300,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
rely < 0 || rely + height > (int) pBoundingDraw->height)
return BadMatch;
rep.depth = pDraw->depth;
reply.depth = pDraw->depth;
if (format == ZPixmap) {
widthBytesLine = PixmapBytePad(width, pDraw->depth);
length = widthBytesLine * height;
@@ -2313,7 +2313,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
Ones(planemask & (plane | (plane - 1)));
}
rep.length = bytes_to_int32(length);
reply.length = bytes_to_int32(length);
if (widthBytesLine == 0 || height == 0)
linesPerBuf = 0;
@@ -2415,10 +2415,10 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
}
if (client->swapped) {
swapl(&rep.visual);
swapl(&reply.visual);
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int
@@ -2678,15 +2678,15 @@ ProcListInstalledColormaps(ClientPtr client)
x_rpcbuf_write_CARD32s(&rpcbuf, cm, nummaps); /* Colormap is an XID, thus CARD32 */
free(cm);
xListInstalledColormapsReply rep = {
xListInstalledColormapsReply reply = {
.nColormaps = nummaps,
};
if (client->swapped) {
swaps(&rep.nColormaps);
swaps(&reply.nColormaps);
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int dixAllocColor(ClientPtr client, Colormap cmap, CARD16 *red,
@@ -2717,26 +2717,27 @@ ProcAllocColor(ClientPtr client)
swaps(&stuff->blue);
}
xAllocColorReply rep = {
xAllocColorReply reply = {
.red = stuff->red,
.green = stuff->green,
.blue = stuff->blue,
};
int rc = dixAllocColor(client, stuff->cmap, &rep.red, &rep.green, &rep.blue, &rep.pixel);
int rc = dixAllocColor(client, stuff->cmap,
&reply.red, &reply.green, &reply.blue, &reply.pixel);
if (rc != Success) {
client->errorValue = stuff->cmap;
return rc;
}
if (client->swapped) {
swaps(&rep.red);
swaps(&rep.green);
swaps(&rep.blue);
swapl(&rep.pixel);
swaps(&reply.red);
swaps(&reply.green);
swaps(&reply.blue);
swapl(&reply.pixel);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -2755,38 +2756,41 @@ ProcAllocNamedColor(ClientPtr client)
return rc;
}
xAllocNamedColorReply rep = { 0 };
xAllocNamedColorReply reply = { 0 };
if (!dixLookupBuiltinColor
((char *) &stuff[1], stuff->nbytes,
&rep.exactRed, &rep.exactGreen, &rep.exactBlue))
&reply.exactRed, &reply.exactGreen, &reply.exactBlue))
return BadName;
rep.screenRed = rep.exactRed;
rep.screenGreen = rep.exactGreen;
rep.screenBlue = rep.exactBlue;
reply.screenRed = reply.exactRed;
reply.screenGreen = reply.exactGreen;
reply.screenBlue = reply.exactBlue;
if ((rc = AllocColor(pcmp,
&rep.screenRed, &rep.screenGreen,
&rep.screenBlue, &rep.pixel, client->index)))
&reply.screenRed,
&reply.screenGreen,
&reply.screenBlue,
&reply.pixel,
client->index)))
return rc;
if (client->swapped) {
swapl(&rep.pixel);
swaps(&rep.exactRed);
swaps(&rep.exactGreen);
swaps(&rep.exactBlue);
swaps(&rep.screenRed);
swaps(&rep.screenGreen);
swaps(&rep.screenBlue);
swapl(&reply.pixel);
swaps(&reply.exactRed);
swaps(&reply.exactGreen);
swaps(&reply.exactBlue);
swaps(&reply.screenRed);
swaps(&reply.screenGreen);
swaps(&reply.screenBlue);
}
#ifdef XINERAMA
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
return Success;
#else
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
#endif /* XINERAMA */
}
@@ -2834,17 +2838,17 @@ ProcAllocColorCells(ClientPtr client)
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif /* XINERAMA */
{
xAllocColorCellsReply rep = {
xAllocColorCellsReply reply = {
.nPixels = npixels,
.nMasks = nmasks
};
if (client->swapped) {
swaps(&rep.nPixels);
swaps(&rep.nMasks);
swaps(&reply.nPixels);
swaps(&reply.nMasks);
SwapLongs(ppixels, length / 4);
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
x_rpcbuf_clear(&rpcbuf);
return Success;
@@ -2880,7 +2884,7 @@ ProcAllocColorPlanes(ClientPtr client)
return BadValue;
}
xAllocColorPlanesReply rep = {
xAllocColorPlanesReply reply = {
.nPixels = npixels
};
length = (long) npixels *sizeof(Pixel);
@@ -2892,25 +2896,25 @@ ProcAllocColorPlanes(ClientPtr client)
if ((rc = AllocColorPlanes(client->index, pcmp, npixels,
(int) stuff->red, (int) stuff->green,
(int) stuff->blue, (Bool) stuff->contiguous,
ppixels, &rep.redMask, &rep.greenMask,
&rep.blueMask))) {
ppixels, &reply.redMask, &reply.greenMask,
&reply.blueMask))) {
x_rpcbuf_clear(&rpcbuf);
return rc;
}
if (client->swapped) {
SwapLongs(ppixels, length / 4);
swaps(&rep.nPixels);
swapl(&rep.redMask);
swapl(&rep.greenMask);
swapl(&rep.blueMask);
swaps(&reply.nPixels);
swapl(&reply.redMask);
swapl(&reply.greenMask);
swapl(&reply.blueMask);
}
#ifdef XINERAMA
if (noPanoramiXExtension || !pcmp->pScreen->myNum)
#endif /* XINERAMA */
{
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
x_rpcbuf_clear(&rpcbuf);
return Success;
@@ -3030,16 +3034,16 @@ ProcQueryColors(ClientPtr client)
return rc;
}
xQueryColorsReply rep = {
xQueryColorsReply reply = {
.nColors = count
};
if (client->swapped) {
swaps(&rep.nColors);
swaps(&reply.nColors);
SwapShorts((short*)prgbs, count * 4); // xrgb = 4 shorts
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
else {
client->errorValue = stuff->cmap;
@@ -3069,7 +3073,7 @@ ProcLookupColor(ClientPtr client)
&exactBlue))
return BadName;
xLookupColorReply rep = {
xLookupColorReply reply = {
.exactRed = exactRed,
.exactGreen = exactGreen,
.exactBlue = exactBlue,
@@ -3078,21 +3082,21 @@ ProcLookupColor(ClientPtr client)
.screenBlue = exactBlue
};
pcmp->pScreen->ResolveColor(&rep.screenRed,
&rep.screenGreen,
&rep.screenBlue,
pcmp->pScreen->ResolveColor(&reply.screenRed,
&reply.screenGreen,
&reply.screenBlue,
pcmp->pVisual);
if (client->swapped) {
swaps(&rep.exactRed);
swaps(&rep.exactGreen);
swaps(&rep.exactBlue);
swaps(&rep.screenRed);
swaps(&rep.screenGreen);
swaps(&rep.screenBlue);
swaps(&reply.exactRed);
swaps(&reply.exactGreen);
swaps(&reply.exactBlue);
swaps(&reply.screenRed);
swaps(&reply.screenGreen);
swaps(&reply.screenBlue);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -3274,17 +3278,17 @@ ProcQueryBestSize(ClientPtr client)
(*pScreen->QueryBestSize) (stuff->class, &stuff->width,
&stuff->height, pScreen);
xQueryBestSizeReply rep = {
xQueryBestSizeReply reply = {
.width = stuff->width,
.height = stuff->height
};
if (client->swapped) {
swaps(&rep.width);
swaps(&rep.height);
swaps(&reply.width);
swaps(&reply.height);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -3357,7 +3361,7 @@ ProcGetScreenSaver(ClientPtr client)
return rc;
});
xGetScreenSaverReply rep = {
xGetScreenSaverReply reply = {
.timeout = ScreenSaverTime / MILLI_PER_SECOND,
.interval = ScreenSaverInterval / MILLI_PER_SECOND,
.preferBlanking = ScreenSaverBlanking,
@@ -3365,11 +3369,11 @@ ProcGetScreenSaver(ClientPtr client)
};
if (client->swapped) {
swaps(&rep.timeout);
swaps(&rep.interval);
swaps(&reply.timeout);
swaps(&reply.interval);
}
return X_SEND_REPLY_SIMPLE(client, rep);
return X_SEND_REPLY_SIMPLE(client, reply);
}
int
@@ -3409,7 +3413,7 @@ ProcListHosts(ClientPtr client)
if (result != Success)
return result;
xListHostsReply rep = {
xListHostsReply reply = {
.enabled = enabled,
.nHosts = nHosts
};
@@ -3427,13 +3431,13 @@ ProcListHosts(ClientPtr client)
bufT += sizeof(xHostEntry) + pad_to_int32(l1);
}
swaps(&rep.nHosts);
swaps(&reply.nHosts);
}
x_rpcbuf_write_CARD8s(&rpcbuf, pdata, len);
free(pdata);
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int
@@ -3540,15 +3544,15 @@ ProcGetFontPath(ClientPtr client)
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
xGetFontPathReply rep = {
xGetFontPathReply reply = {
.nPaths = FillFontPath(&rpcbuf)
};
if (client->swapped) {
swaps(&rep.nPaths);
swaps(&reply.nPaths);
}
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int
@@ -3938,7 +3942,7 @@ void
SendErrorToClient(ClientPtr client, CARD8 majorCode, CARD16 minorCode,
XID resId, BYTE errorCode)
{
xError rep = {
xError reply = {
.type = X_Error,
.errorCode = errorCode,
.resourceID = resId,
@@ -3946,7 +3950,7 @@ SendErrorToClient(ClientPtr client, CARD8 majorCode, CARD16 minorCode,
.majorCode = majorCode
};
WriteEventsToClient(client, 1, (xEvent *) &rep);
WriteEventsToClient(client, 1, (xEvent *) &reply);
}
void