summaryrefslogtreecommitdiff
path: root/Xext/shape.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xext/shape.c')
-rw-r--r--Xext/shape.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/Xext/shape.c b/Xext/shape.c
index 7724e7bb2..ecc6c8817 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -204,15 +204,16 @@ CreateClipShape(WindowPtr pWin)
static int
ProcShapeQueryVersion(ClientPtr client)
{
- xShapeQueryVersionReply rep;
+ xShapeQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = SERVER_SHAPE_MAJOR_VERSION,
+ .minorVersion = SERVER_SHAPE_MINOR_VERSION
+ };
REQUEST_SIZE_MATCH(xShapeQueryVersionReq);
- memset(&rep, 0, sizeof(xShapeQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
- rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -631,12 +632,13 @@ ProcShapeQueryExtents(ClientPtr client)
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
- memset(&rep, 0, sizeof(xShapeQueryExtentsReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.boundingShaped = (wBoundingShape(pWin) != 0);
- rep.clipShaped = (wClipShape(pWin) != 0);
+ rep = (xShapeQueryExtentsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .boundingShaped = (wBoundingShape(pWin) != 0),
+ .clipShaped = (wClipShape(pWin) != 0)
+ };
if ((region = wBoundingShape(pWin))) {
/* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
pExtents = RegionExtents(region);
@@ -920,10 +922,12 @@ ProcShapeInputSelected(ClientPtr client)
}
}
}
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.enabled = enabled;
+ rep = (xShapeInputSelectedReply) {
+ .type = X_Reply,
+ .enabled = enabled,
+ .sequenceNumber = client->sequence,
+ .length = 0
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -1001,11 +1005,13 @@ ProcShapeGetRectangles(ClientPtr client)
rects[i].height = box->y2 - box->y1;
}
}
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32(nrects * sizeof(xRectangle));
- rep.ordering = YXBanded;
- rep.nrects = nrects;
+ rep = (xShapeGetRectanglesReply) {
+ .type = X_Reply,
+ .ordering = YXBanded,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(nrects * sizeof(xRectangle)),
+ .nrects = nrects
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);