aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/shape.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext/shape.c')
-rw-r--r--xorg-server/Xext/shape.c77
1 files changed, 38 insertions, 39 deletions
diff --git a/xorg-server/Xext/shape.c b/xorg-server/Xext/shape.c
index bb479b159..c6ff360ac 100644
--- a/xorg-server/Xext/shape.c
+++ b/xorg-server/Xext/shape.c
@@ -26,6 +26,8 @@ in this Software without prior written authorization from The Open Group.
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
+#else
+#define SHAPE
#endif
#include <stdlib.h>
@@ -204,16 +206,15 @@ CreateClipShape(WindowPtr pWin)
static int
ProcShapeQueryVersion(ClientPtr client)
{
- xShapeQueryVersionReply rep = {
- .type = X_Reply,
- .sequenceNumber = client->sequence,
- .length = 0,
- .majorVersion = SERVER_SHAPE_MAJOR_VERSION,
- .minorVersion = SERVER_SHAPE_MINOR_VERSION
- };
+ xShapeQueryVersionReply rep;
REQUEST_SIZE_MATCH(xShapeQueryVersionReq);
-
+ memset(&rep, 0, sizeof(xShapeQueryVersionReply));
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
+ rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -632,13 +633,12 @@ ProcShapeQueryExtents(ClientPtr client)
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
- rep = (xShapeQueryExtentsReply) {
- .type = X_Reply,
- .sequenceNumber = client->sequence,
- .length = 0,
- .boundingShaped = (wBoundingShape(pWin) != 0),
- .clipShaped = (wClipShape(pWin) != 0)
- };
+ memset(&rep, 0, sizeof(xShapeQueryExtentsReply));
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.boundingShaped = (wBoundingShape(pWin) != 0);
+ rep.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);
@@ -882,17 +882,16 @@ SendShapeNotify(WindowPtr pWin, int which)
return;
}
for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
- xShapeNotifyEvent se = {
- .type = ShapeNotify + ShapeEventBase,
- .kind = which,
- .window = pWin->drawable.id,
- .x = extents.x1,
- .y = extents.y1,
- .width = extents.x2 - extents.x1,
- .height = extents.y2 - extents.y1,
- .time = currentTime.milliseconds,
- .shaped = shaped
- };
+ xShapeNotifyEvent se;
+ se.type = ShapeNotify + ShapeEventBase;
+ se.kind = which;
+ se.window = pWin->drawable.id;
+ se.x = extents.x1;
+ se.y = extents.y1;
+ se.width = extents.x2 - extents.x1;
+ se.height = extents.y2 - extents.y1;
+ se.time = currentTime.milliseconds;
+ se.shaped = shaped;
WriteEventsToClient(pShapeEvent->client, 1, (xEvent *) &se);
}
}
@@ -923,12 +922,12 @@ ProcShapeInputSelected(ClientPtr client)
}
}
}
- rep = (xShapeInputSelectedReply) {
- .type = X_Reply,
- .enabled = enabled,
- .sequenceNumber = client->sequence,
- .length = 0
- };
+
+ rep.type = X_Reply;
+ rep.enabled = enabled;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -1006,13 +1005,13 @@ ProcShapeGetRectangles(ClientPtr client)
rects[i].height = box->y2 - box->y1;
}
}
- rep = (xShapeGetRectanglesReply) {
- .type = X_Reply,
- .ordering = YXBanded,
- .sequenceNumber = client->sequence,
- .length = bytes_to_int32(nrects * sizeof(xRectangle)),
- .nrects = nrects
- };
+
+ rep.type = X_Reply;
+ rep.ordering = YXBanded;
+ rep.sequenceNumber = client->sequence;
+ rep.length = bytes_to_int32(nrects * sizeof(xRectangle));
+ rep.nrects = nrects;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);