mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Remove dixRegisterPrivateOffset; hard-code devPrivates offsets instead
For predefined resource types, the offset of the devPrivates field was already kept in a constant table. The only non-predefined type needing this treatment was dbeDrawableResType, which is just a magic alias for RT_PIXMAP. This patch special-cases looking up RC_DRAWABLE offsets and uses the table directly for everything else. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
@@ -107,26 +107,16 @@ dixFreePrivates(PrivateRec *privates);
|
||||
extern _X_EXPORT int
|
||||
dixResetPrivates(void);
|
||||
|
||||
/*
|
||||
* These next two functions are necessary because the position of
|
||||
* the devPrivates field varies by structure and calling code might
|
||||
* only know the resource type, not the structure definition.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Looks up the offset where the devPrivates field is located.
|
||||
* Returns -1 if no offset has been registered for the resource type.
|
||||
* Returns -1 if the specified resource has no dev privates.
|
||||
* The position of the devPrivates field varies by structure
|
||||
* and calling code might only know the resource type, not the
|
||||
* structure definition.
|
||||
*/
|
||||
extern _X_EXPORT int
|
||||
dixLookupPrivateOffset(RESTYPE type);
|
||||
|
||||
/*
|
||||
* Specifies the offset where the devPrivates field is located.
|
||||
* A negative value indicates no devPrivates field is available.
|
||||
*/
|
||||
extern _X_EXPORT int
|
||||
dixRegisterPrivateOffset(RESTYPE type, int offset);
|
||||
|
||||
/*
|
||||
* Convenience macro for adding an offset to an object pointer
|
||||
* when making a call to one of the devPrivates functions
|
||||
|
||||
Reference in New Issue
Block a user