diff options
Diffstat (limited to 'xorg-server/dix/property.c')
-rw-r--r-- | xorg-server/dix/property.c | 75 |
1 files changed, 36 insertions, 39 deletions
diff --git a/xorg-server/dix/property.c b/xorg-server/dix/property.c index 9f51cd0ff..b40e6f0c1 100644 --- a/xorg-server/dix/property.c +++ b/xorg-server/dix/property.c @@ -108,12 +108,12 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName, static void deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom) { - xEvent event = { - .u.property.window = pWin->drawable.id, - .u.property.state = state, - .u.property.atom = atom, - .u.property.time = currentTime.milliseconds - }; + xEvent event; memset(&event, 0, sizeof(xEvent)); + event.u.property.window = pWin->drawable.id; + event.u.property.state = state; + event.u.property.atom = atom; + event.u.property.time = currentTime.milliseconds; + event.u.u.type = PropertyNotify; DeliverEvents(pWin, &event, 1, (WindowPtr) NULL); } @@ -414,15 +414,14 @@ DeleteAllWindowProperties(WindowPtr pWin) static int NullPropertyReply(ClientPtr client, ATOM propertyType, int format) { - xGetPropertyReply reply = { - .type = X_Reply, - .format = format, - .sequenceNumber = client->sequence, - .length = 0, - .propertyType = propertyType, - .bytesAfter = 0, - .nItems = 0 - }; + xGetPropertyReply reply; + reply.type = X_Reply; + reply.format = format; + reply.sequenceNumber = client->sequence; + reply.length = 0; + reply.propertyType = propertyType; + reply.bytesAfter = 0; + reply.nItems = 0; WriteReplyToClient(client, sizeof(xGenericReply), &reply); return Success; } @@ -483,15 +482,14 @@ ProcGetProperty(ClientPtr client) if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType)) ) { - reply = (xGetPropertyReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .bytesAfter = pProp->size, - .format = pProp->format, - .length = 0, - .nItems = 0, - .propertyType = pProp->type - }; + memset(&reply, 0, sizeof(xGetPropertyReply)); + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.bytesAfter = pProp->size; + reply.format = pProp->format; + reply.length = 0; + reply.nItems = 0; + reply.propertyType = pProp->type; WriteReplyToClient(client, sizeof(xGenericReply), &reply); return Success; } @@ -512,15 +510,14 @@ ProcGetProperty(ClientPtr client) len = min(n - ind, 4 * stuff->longLength); - reply = (xGetPropertyReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .bytesAfter = n - (ind + len), - .format = pProp->format, - .length = bytes_to_int32(len), - .nItems = len / (pProp->format / 8), - .propertyType = pProp->type - }; + memset(&reply, 0, sizeof(xGetPropertyReply)); + reply.type = X_Reply; + reply.sequenceNumber = client->sequence, + reply.bytesAfter = n - (ind + len); + reply.format = pProp->format; + reply.length = bytes_to_int32(len); + reply.nItems = len / (pProp->format / 8); + reply.propertyType = pProp->type; if (stuff->delete && (reply.bytesAfter == 0)) deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); @@ -595,12 +592,12 @@ ProcListProperties(ClientPtr client) } } - xlpr = (xListPropertiesReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = bytes_to_int32(numProps * sizeof(Atom)), - .nProperties = numProps - }; + + xlpr.type = X_Reply; + xlpr.sequenceNumber = client->sequence; + xlpr.length = bytes_to_int32(numProps * sizeof(Atom)); + xlpr.nProperties = numProps; + WriteReplyToClient(client, sizeof(xGenericReply), &xlpr); if (numProps) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; |