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>
This commit is contained in:
parent
cdf5bcd420
commit
69fa5630b5
|
@ -3625,14 +3625,13 @@ void
|
||||||
SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode,
|
SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode,
|
||||||
XID resId, int errorCode)
|
XID resId, int errorCode)
|
||||||
{
|
{
|
||||||
xError rep;
|
xError rep = {
|
||||||
|
.type = X_Error,
|
||||||
memset(&rep, 0, sizeof(xError));
|
.errorCode = errorCode,
|
||||||
rep.type = X_Error;
|
.resourceID = resId,
|
||||||
rep.errorCode = errorCode;
|
.minorCode = minorCode,
|
||||||
rep.majorCode = majorCode;
|
.majorCode = majorCode
|
||||||
rep.minorCode = minorCode;
|
};
|
||||||
rep.resourceID = resId;
|
|
||||||
|
|
||||||
WriteEventsToClient(client, 1, (xEvent *) &rep);
|
WriteEventsToClient(client, 1, (xEvent *) &rep);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue