devPrivates rework: pass address of pointer to private callbacks instead of
the pointer itself.
This commit is contained in:
parent
18339375cd
commit
fe05ba75a1
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user