ProcX{Change|Query}WindowAccess: change device list from char* to XID*.

This commit is contained in:
Paulo Ricardo Zanoni 2007-07-10 10:08:44 +09:30 committed by Peter Hutterer
parent 5ccc09b182
commit c1a6841a64
2 changed files with 8 additions and 8 deletions

View File

@ -65,7 +65,7 @@ int
ProcXChangeWindowAccess(ClientPtr client)
{
int padding, err, i;
CARD8* deviceids = NULL;
XID* deviceids = NULL;
WindowPtr win;
DeviceIntPtr* perm_devices = NULL;
DeviceIntPtr* deny_devices = NULL;
@ -73,10 +73,10 @@ ProcXChangeWindowAccess(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xChangeWindowAccessReq);
padding = (4 - ((stuff->npermit + stuff->ndeny) % 4)) % 4;
padding = (4 - (((stuff->npermit + stuff->ndeny) * sizeof(XID)) % 4)) % 4;
if (stuff->length != ((sizeof(xChangeWindowAccessReq) +
(stuff->npermit + stuff->ndeny + padding)) >> 2))
(((stuff->npermit + stuff->ndeny) * sizeof(XID)) + padding)) >> 2))
{
SendErrorToClient(client, IReqCode, X_ChangeWindowAccess,
0, BadLength);
@ -102,7 +102,7 @@ ProcXChangeWindowAccess(ClientPtr client)
}
if (stuff->npermit || stuff->ndeny)
deviceids = (CARD8*)&stuff[1];
deviceids = (XID*)&stuff[1];
if (stuff->npermit)
{

View File

@ -69,7 +69,7 @@ ProcXQueryWindowAccess(ClientPtr client)
DeviceIntPtr *perm, *deny;
int nperm, ndeny, i;
int defaultRule;
CARD8* deviceids;
XID* deviceids;
xQueryWindowAccessReply rep;
REQUEST(xQueryWindowAccessReq);
@ -88,7 +88,7 @@ ProcXQueryWindowAccess(ClientPtr client)
rep.repType = X_Reply;
rep.RepType = X_QueryWindowAccess;
rep.sequenceNumber = client->sequence;
rep.length = (nperm + ndeny + 3) >> 2;
rep.length = ((nperm + ndeny) * sizeof(XID) + 3) >> 2;
rep.defaultRule = defaultRule;
rep.npermit = nperm;
rep.ndeny = ndeny;
@ -96,7 +96,7 @@ ProcXQueryWindowAccess(ClientPtr client)
if (nperm + ndeny)
{
deviceids = (CARD8*)xalloc((nperm + ndeny) * sizeof(CARD8));
deviceids = (XID*)xalloc((nperm + ndeny) * sizeof(XID));
if (!deviceids)
{
ErrorF("ProcXQueryWindowAccess: xalloc failure.\n");
@ -110,7 +110,7 @@ ProcXQueryWindowAccess(ClientPtr client)
for (i = 0; i < ndeny; i++)
deviceids[i + nperm] = deny[i]->id;
WriteToClient(client, nperm + ndeny, (char*)deviceids);
WriteToClient(client, (nperm + ndeny) * sizeof(XID), (char*)deviceids);
xfree(deviceids);
}
return Success;