summaryrefslogtreecommitdiff
path: root/Xext/xselinux_ext.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:12:43 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-09 19:58:30 -0700
commit6a721e3af5e11bae1d59ca551a02470f35d9e844 (patch)
treeb95dd0d69fca66321f010959e69c44f781452c1f /Xext/xselinux_ext.c
parentd792ac125a0462a04a930af543cbc732f8cdab7d (diff)
Use C99 designated initializers in Xext Replies
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 'Xext/xselinux_ext.c')
-rw-r--r--Xext/xselinux_ext.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c
index 881759137..d22c2f1fd 100644
--- a/Xext/xselinux_ext.c
+++ b/Xext/xselinux_ext.c
@@ -63,13 +63,13 @@ SELinuxCopyContext(char *ptr, unsigned len)
static int
ProcSELinuxQueryVersion(ClientPtr client)
{
- SELinuxQueryVersionReply rep;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.server_major = SELINUX_MAJOR_VERSION;
- rep.server_minor = SELINUX_MINOR_VERSION;
+ SELinuxQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .server_major = SELINUX_MAJOR_VERSION,
+ .server_minor = SELINUX_MINOR_VERSION
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -93,10 +93,12 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
len = strlen(ctx) + 1;
}
- rep.type = X_Reply;
- rep.length = bytes_to_int32(len);
- rep.sequenceNumber = client->sequence;
- rep.context_len = len;
+ rep = (SELinuxGetContextReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(len),
+ .context_len = len
+ };
if (client->swapped) {
swapl(&rep.length);
@@ -372,10 +374,12 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
}
/* Send reply to client */
- rep.type = X_Reply;
- rep.length = size;
- rep.sequenceNumber = client->sequence;
- rep.count = count;
+ rep = (SELinuxListItemsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = size,
+ .count = count
+ };
if (client->swapped) {
swapl(&rep.length);