diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:58:29 -0700 |
commit | 69fa5630b5902aaad267fc67d0da4ca93625886a (patch) | |
tree | e66abf7679c898b500f6709063627ab63eff0073 /dix | |
parent | cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e (diff) |
Use C99 designated initializers in SendErrorToClient
Let the compiler worry about 0-filling the rest of the fields,
instead of memsetting the whole struct and then going back to
overwrite some of the fields.
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/dispatch.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 787f87f72..5982a49ae 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3625,14 +3625,13 @@ void SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, XID resId, int errorCode) { - xError rep; - - memset(&rep, 0, sizeof(xError)); - rep.type = X_Error; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; + xError rep = { + .type = X_Error, + .errorCode = errorCode, + .resourceID = resId, + .minorCode = minorCode, + .majorCode = majorCode + }; WriteEventsToClient(client, 1, (xEvent *) &rep); } |