[PATCH 04/19] Use C99 designated initializers in dix Replies

Keith Packard keithp at keithp.com
Mon Jul 2 10:47:00 PDT 2012

Alan Coopersmith <alan.coopersmith at oracle.com> writes:

Ok, I like the general plan here, but there are a mish-mash of styles
which doesn't really seem neater than the original code.

If we can, indeed, use this form:

> +
> +    reply = (xQueryTreeReply) {
> +        .type = X_Reply,
> +        .sequenceNumber = client->sequence,
> +        .root = pWin->drawable.pScreen->root->drawable.id,
> +        .parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None
> +    };

then I'd like to see that used uniformly as it will eliminate the need
to create artificial blocks to place new declarations and initializers
in, and will make the patch a lot easier to read -- you'd be replacing a
sequence of assignment statements with a single struct assignment.

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120702/915e58af/attachment.pgp>

More information about the xorg-devel mailing list