summaryrefslogtreecommitdiff
path: root/record/record.c
diff options
context:
space:
mode:
Diffstat (limited to 'record/record.c')
-rw-r--r--record/record.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/record/record.c b/record/record.c
index f580f643e..debe3c472 100644
--- a/record/record.c
+++ b/record/record.c
@@ -164,13 +164,13 @@ typedef struct {
ProcFunctionPtr recordVector[256];
} RecordClientPrivateRec, *RecordClientPrivatePtr;
-static int RecordClientPrivateIndex;
+static DevPrivateKey RecordClientPrivateKey = &RecordClientPrivateKey;
/* RecordClientPrivatePtr RecordClientPrivate(ClientPtr)
* gets the client private of the given client. Syntactic sugar.
*/
#define RecordClientPrivate(_pClient) (RecordClientPrivatePtr) \
- ((_pClient)->devPrivates[RecordClientPrivateIndex].ptr)
+ dixLookupPrivate(&(_pClient)->devPrivates, RecordClientPrivateKey)
/***************************************************************************/
@@ -982,8 +982,8 @@ RecordInstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
memcpy(pClientPriv->recordVector, pClient->requestVector,
sizeof (pClientPriv->recordVector));
pClientPriv->originalVector = pClient->requestVector;
- pClient->devPrivates[RecordClientPrivateIndex].ptr =
- (pointer)pClientPriv;
+ dixSetPrivate(&pClient->devPrivates,
+ RecordClientPrivateKey, pClientPriv);
pClient->requestVector = pClientPriv->recordVector;
}
while ((pIter = RecordIterateSet(pRCAP->pRequestMajorOpSet,
@@ -1096,7 +1096,8 @@ RecordUninstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
if (!otherRCAPwantsProcVector)
{ /* nobody needs it, so free it */
pClient->requestVector = pClientPriv->originalVector;
- pClient->devPrivates[RecordClientPrivateIndex].ptr = NULL;
+ dixSetPrivate(&pClient->devPrivates,
+ RecordClientPrivateKey, NULL);
xfree(pClientPriv);
}
} /* end if this RCAP specifies any requests */
@@ -2948,10 +2949,6 @@ RecordExtensionInit(void)
if (!RTContext)
return;
- RecordClientPrivateIndex = AllocateClientPrivateIndex();
- if (!AllocateClientPrivate(RecordClientPrivateIndex, 0))
- return;
-
ppAllContexts = NULL;
numContexts = numEnabledContexts = numEnabledRCAPs = 0;