summaryrefslogtreecommitdiff
path: root/Xext/security.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/security.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/security.c')
-rw-r--r--Xext/security.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/Xext/security.c b/Xext/security.c
index fd63571b9..4144d859d 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -338,14 +338,16 @@ static int
ProcSecurityQueryVersion(ClientPtr client)
{
/* REQUEST(xSecurityQueryVersionReq); */
- xSecurityQueryVersionReply rep;
+ xSecurityQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = SERVER_SECURITY_MAJOR_VERSION,
+ .minorVersion = SERVER_SECURITY_MINOR_VERSION
+ };
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
- rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swaps(&rep.majorVersion);
@@ -527,11 +529,13 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
/* tell client the auth id and data */
- rep.type = X_Reply;
- rep.length = bytes_to_int32(authdata_len);
- rep.sequenceNumber = client->sequence;
- rep.authId = authId;
- rep.dataLength = authdata_len;
+ rep = (xSecurityGenerateAuthorizationReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(authdata_len),
+ .authId = authId,
+ .dataLength = authdata_len
+ };
if (client->swapped) {
swapl(&rep.length);