summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Ricardo Zanoni <prz05@c3sl.ufpr.br>2007-07-10 10:08:44 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-07-10 10:08:44 +0930
commitc1a6841a64576b7e688e9ca0d3e0db8acf52d4ae (patch)
tree963f1b52f5d9f9635cc9d50f0788048b6085f03d
parent5ccc09b18244f91a06b3bea20b02a97280d1a229 (diff)
ProcX{Change|Query}WindowAccess: change device list from char* to XID*.
-rw-r--r--Xi/chaccess.c8
-rw-r--r--Xi/qryacces.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/Xi/chaccess.c b/Xi/chaccess.c
index 5005e9435..f09920600 100644
--- a/Xi/chaccess.c
+++ b/Xi/chaccess.c
@@ -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)
{
diff --git a/Xi/qryacces.c b/Xi/qryacces.c
index 817bec8a3..b59696939 100644
--- a/Xi/qryacces.c
+++ b/Xi/qryacces.c
@@ -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;