devPrivates rework: pass address of pointer to private callbacks instead of

the pointer itself.
This commit is contained in:
Eamon Walsh 2007-03-08 12:14:30 -05:00 committed by Eamon Walsh
parent 18339375cd
commit fe05ba75a1
2 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,7 @@ dixAllocatePrivate(PrivateRec **privates, devprivate_key_t *const key)
/* call any init funcs and return */
if (item) {
PrivateCallbackRec calldata = { key, ptr->value };
PrivateCallbackRec calldata = { key, &ptr->value };
CallCallbacks(&item->initfuncs, &calldata);
}
return &ptr->value;
@ -138,7 +138,7 @@ dixFreePrivates(PrivateRec *privates)
item = findItem(ptr->key);
if (item) {
calldata.key = ptr->key;
calldata.value = ptr->value;
calldata.value = &ptr->value;
CallCallbacks(&item->deletefuncs, &calldata);
}
}

View File

@ -112,7 +112,7 @@ dixSetPrivate(PrivateRec **privates, devprivate_key_t *const key, pointer val)
*/
typedef struct _PrivateCallback {
devprivate_key_t *key; /* private registration key */
pointer value; /* pointer to private */
pointer *value; /* address of private pointer */
} PrivateCallbackRec;
extern int