(!1601) Xext: xres: ProcXResQueryClients() simplify payload write out
Collect the few bits in a local array, so one WriteToClient() call is sufficient. That's also easing further simplifications in upcoming commits. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
fffbdc0f1e
commit
924540c44d
15
Xext/xres.c
15
Xext/xres.c
|
@ -242,21 +242,22 @@ ProcXResQueryClients(ClientPtr client)
|
||||||
}
|
}
|
||||||
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
|
WriteToClient(client, sizeof(xXResQueryClientsReply), &rep);
|
||||||
|
|
||||||
if (num_clients) {
|
xXResClient scratch[num_clients];
|
||||||
xXResClient scratch;
|
|
||||||
|
|
||||||
|
if (num_clients) {
|
||||||
for (i = 0; i < num_clients; i++) {
|
for (i = 0; i < num_clients; i++) {
|
||||||
scratch.resource_base = clients[current_clients[i]]->clientAsMask;
|
scratch[i].resource_base = clients[current_clients[i]]->clientAsMask;
|
||||||
scratch.resource_mask = RESOURCE_ID_MASK;
|
scratch[i].resource_mask = RESOURCE_ID_MASK;
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swapl(&scratch.resource_base);
|
swapl(&scratch[i].resource_base);
|
||||||
swapl(&scratch.resource_mask);
|
swapl(&scratch[i].resource_mask);
|
||||||
}
|
}
|
||||||
WriteToClient(client, sz_xXResClient, &scratch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(scratch), scratch);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue