summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:42 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:14:50 -0700
commitdb69212df8a0bf09140368356d2d430c54afe346 (patch)
treebd060a0be6cf0f0bc4f8ea7273003b8e44e61ea7 /dix
parent6be74a9080e30fc502421cd438cd0c73fb8eb0b0 (diff)
Rework reply initialization in ProcGetProperty & NullPropertyReply
Don't need to pass an empty reply to NullPropertyReply, let it make it's own. Move reply initialization code in remaining replies in ProcGetProperty to group with the rest of the fields. (Prepares for coming C99 designated initializer conversion.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'dix')
-rw-r--r--dix/property.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/dix/property.c b/dix/property.c
index b1b83124f..5ef97ee81 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -413,15 +413,18 @@ DeleteAllWindowProperties(WindowPtr pWin)
}
static int
-NullPropertyReply(ClientPtr client,
- ATOM propertyType, int format, xGetPropertyReply * reply)
+NullPropertyReply(ClientPtr client, ATOM propertyType, int format)
{
- reply->nItems = 0;
- reply->length = 0;
- reply->bytesAfter = 0;
- reply->propertyType = propertyType;
- reply->format = format;
- WriteReplyToClient(client, sizeof(xGenericReply), reply);
+ xGetPropertyReply reply;
+ memset(&reply, 0, sizeof(xGetPropertyReply));
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
+ reply.nItems = 0;
+ reply.length = 0;
+ reply.bytesAfter = 0;
+ reply.propertyType = propertyType;
+ reply.format = format;
+ WriteReplyToClient(client, sizeof(xGenericReply), &reply);
return Success;
}
@@ -470,13 +473,9 @@ ProcGetProperty(ClientPtr client)
return BadAtom;
}
- memset(&reply, 0, sizeof(xGetPropertyReply));
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
-
rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode);
if (rc == BadMatch)
- return NullPropertyReply(client, None, 0, &reply);
+ return NullPropertyReply(client, None, 0);
else if (rc != Success)
return rc;
@@ -485,6 +484,9 @@ ProcGetProperty(ClientPtr client)
if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType))
) {
+ memset(&reply, 0, sizeof(xGetPropertyReply));
+ reply.type = X_Reply;
+ reply.sequenceNumber = client->sequence;
reply.bytesAfter = pProp->size;
reply.format = pProp->format;
reply.length = 0;
@@ -510,6 +512,9 @@ ProcGetProperty(ClientPtr client)
len = min(n - ind, 4 * stuff->longLength);
+ 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);