Merge remote branch 'ajax/for-keithp'

This commit is contained in:
Keith Packard
2011-01-20 21:21:21 -08:00
6 changed files with 42 additions and 79 deletions

View File

@@ -167,7 +167,6 @@ typedef struct _Resource {
RESTYPE type;
pointer value;
} ResourceRec, *ResourcePtr;
#define NullResource ((ResourcePtr)NULL)
typedef struct _ClientResource {
ResourcePtr *resources;
@@ -176,7 +175,6 @@ typedef struct _ClientResource {
int hashsize; /* log(2)(buckets) */
XID fakeID;
XID endFakeID;
XID expectID;
} ClientResourceRec;
RESTYPE lastResourceType;
@@ -323,10 +321,9 @@ InitClientResources(ClientPtr client)
clientTable[i].fakeID = client->clientAsMask |
(client->index ? SERVER_BIT : SERVER_MINID);
clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1;
clientTable[i].expectID = client->clientAsMask;
for (j=0; j<INITBUCKETS; j++)
{
clientTable[i].resources[j] = NullResource;
clientTable[i].resources[j] = NULL;
}
return TRUE;
}
@@ -512,8 +509,6 @@ AddResource(XID id, RESTYPE type, pointer value)
res->value = value;
*head = res;
rrec->elements++;
if (!(id & SERVER_BIT) && (id >= rrec->expectID))
rrec->expectID = id + 1;
CallResourceStateCallback(ResourceStateAdding, res);
return TRUE;
}
@@ -543,7 +538,7 @@ RebuildTable(int client)
}
for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++)
{
*rptr = NullResource;
*rptr = NULL;
*tptr = rptr;
}
clientTable[client].hashsize++;
@@ -555,7 +550,7 @@ RebuildTable(int client)
for (res = *rptr; res; res = next)
{
next = res->next;
res->next = NullResource;
res->next = NULL;
tptr = &tails[Hash(client, res->id)];
**tptr = res;
*tptr = &res->next;
@@ -886,24 +881,21 @@ LegalNewID(XID id, ClientPtr client)
#ifdef PANORAMIX
XID minid, maxid;
if (!noPanoramiXExtension) {
minid = client->clientAsMask | (client->index ?
SERVER_BIT : SERVER_MINID);
maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1;
if ((id >= minid) && (id <= maxid))
return TRUE;
}
if (!noPanoramiXExtension) {
minid = client->clientAsMask | (client->index ?
SERVER_BIT : SERVER_MINID);
maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1;
if ((id >= minid) && (id <= maxid))
return TRUE;
}
#endif /* PANORAMIX */
if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
{
if (clientTable[client->index].expectID <= id)
return TRUE;
rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
DixGetAttrAccess);
return rc == BadValue;
}
return FALSE;
if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
{
rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
DixGetAttrAccess);
return rc == BadValue;
}
return FALSE;
}
int