devPrivates rework: move reset functions into a single call.
This commit is contained in:
parent
bb111291d8
commit
aaef4d6a41
|
@ -359,15 +359,7 @@ main(int argc, char *argv[], char *envp[])
|
|||
InitGlyphCaching();
|
||||
if (!dixResetPrivates())
|
||||
FatalError("couldn't init private data storage");
|
||||
ResetExtensionPrivates();
|
||||
ResetClientPrivates();
|
||||
ResetScreenPrivates();
|
||||
ResetWindowPrivates();
|
||||
ResetGCPrivates();
|
||||
ResetPixmapPrivates();
|
||||
ResetColormapPrivates();
|
||||
ResetFontPrivateIndex();
|
||||
ResetDevicePrivateIndex();
|
||||
InitCallbackManager();
|
||||
InitVisualWrap();
|
||||
InitOutput(&screenInfo, argc, argv);
|
||||
|
|
|
@ -279,6 +279,15 @@ dixLookupPrivateOffset(RESTYPE type)
|
|||
/*
|
||||
* Called from the main loop to reset the subsystem.
|
||||
*/
|
||||
static void ResetExtensionPrivates(void);
|
||||
static void ResetClientPrivates(void);
|
||||
static void ResetScreenPrivates(void);
|
||||
static void ResetWindowPrivates(void);
|
||||
static void ResetGCPrivates(void);
|
||||
static void ResetPixmapPrivates(void);
|
||||
static void ResetColormapPrivates(void);
|
||||
static void ResetDevicePrivateIndex(void);
|
||||
|
||||
int
|
||||
dixResetPrivates(void)
|
||||
{
|
||||
|
@ -297,6 +306,16 @@ dixResetPrivates(void)
|
|||
if (!offsets)
|
||||
return FALSE;
|
||||
|
||||
/* reset legacy devPrivates support */
|
||||
ResetExtensionPrivates();
|
||||
ResetClientPrivates();
|
||||
ResetScreenPrivates();
|
||||
ResetWindowPrivates();
|
||||
ResetGCPrivates();
|
||||
ResetPixmapPrivates();
|
||||
ResetColormapPrivates();
|
||||
ResetDevicePrivateIndex();
|
||||
|
||||
/* register basic resource offsets */
|
||||
if (!dixRegisterPrivateOffset(RT_WINDOW, offsetof(WindowRec,devPrivates)))
|
||||
return FALSE;
|
||||
|
@ -324,7 +343,7 @@ int extensionPrivateLen;
|
|||
unsigned *extensionPrivateSizes;
|
||||
unsigned totalExtensionSize;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetExtensionPrivates()
|
||||
{
|
||||
extensionPrivateCount = 0;
|
||||
|
@ -381,7 +400,7 @@ int clientPrivateLen;
|
|||
unsigned *clientPrivateSizes;
|
||||
unsigned totalClientSize;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetClientPrivates()
|
||||
{
|
||||
clientPrivateCount = 0;
|
||||
|
@ -435,7 +454,7 @@ AllocateClientPrivate(int index2, unsigned amount)
|
|||
|
||||
int screenPrivateCount;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetScreenPrivates()
|
||||
{
|
||||
screenPrivateCount = 0;
|
||||
|
@ -477,7 +496,7 @@ AllocateScreenPrivateIndex()
|
|||
|
||||
static int windowPrivateCount;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetWindowPrivates()
|
||||
{
|
||||
windowPrivateCount = 0;
|
||||
|
@ -527,7 +546,7 @@ AllocateWindowPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
|
|||
|
||||
static int gcPrivateCount;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetGCPrivates()
|
||||
{
|
||||
gcPrivateCount = 0;
|
||||
|
@ -576,7 +595,7 @@ AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
|
|||
*/
|
||||
static int pixmapPrivateCount;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetPixmapPrivates()
|
||||
{
|
||||
pixmapPrivateCount = 0;
|
||||
|
@ -627,7 +646,7 @@ AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount)
|
|||
|
||||
int colormapPrivateCount;
|
||||
|
||||
void
|
||||
static void
|
||||
ResetColormapPrivates()
|
||||
{
|
||||
colormapPrivateCount = 0;
|
||||
|
@ -712,7 +731,7 @@ AllocateDevicePrivate(DeviceIntPtr device, int index)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
ResetDevicePrivateIndex(void)
|
||||
{
|
||||
devicePrivateIndex = 0;
|
||||
|
|
|
@ -591,8 +591,6 @@ void
|
|||
ScreenRestructured (ScreenPtr pScreen);
|
||||
#endif
|
||||
|
||||
extern void ResetClientPrivates(void);
|
||||
|
||||
extern int AllocateClientPrivateIndex(void);
|
||||
|
||||
extern Bool AllocateClientPrivate(
|
||||
|
|
|
@ -58,8 +58,6 @@ extern Bool EnableDisableExtension(char *name, Bool enable);
|
|||
|
||||
extern void EnableDisableExtensionError(char *name, Bool enable);
|
||||
|
||||
extern void ResetExtensionPrivates(void);
|
||||
|
||||
extern int AllocateExtensionPrivateIndex(void);
|
||||
|
||||
extern Bool AllocateExtensionPrivate(
|
||||
|
|
|
@ -160,7 +160,6 @@ typedef struct {
|
|||
|
||||
extern int AllocateDevicePrivateIndex(void);
|
||||
extern Bool AllocateDevicePrivate(DeviceIntPtr device, int index);
|
||||
extern void ResetDevicePrivateIndex(void);
|
||||
|
||||
extern KeybdCtrl defaultKeyboardControl;
|
||||
extern PtrCtrl defaultPointerControl;
|
||||
|
|
|
@ -55,12 +55,8 @@ typedef struct _Visual *VisualPtr;
|
|||
typedef struct _Depth *DepthPtr;
|
||||
typedef struct _Screen *ScreenPtr;
|
||||
|
||||
extern void ResetScreenPrivates(void);
|
||||
|
||||
extern int AllocateScreenPrivateIndex(void);
|
||||
|
||||
extern void ResetWindowPrivates(void);
|
||||
|
||||
extern int AllocateWindowPrivateIndex(void);
|
||||
|
||||
extern Bool AllocateWindowPrivate(
|
||||
|
@ -68,8 +64,6 @@ extern Bool AllocateWindowPrivate(
|
|||
int /* index */,
|
||||
unsigned /* amount */);
|
||||
|
||||
extern void ResetGCPrivates(void);
|
||||
|
||||
extern int AllocateGCPrivateIndex(void);
|
||||
|
||||
extern Bool AllocateGCPrivate(
|
||||
|
@ -86,8 +80,6 @@ extern int AddScreen(
|
|||
int /*argc*/,
|
||||
char** /*argv*/);
|
||||
|
||||
extern void ResetPixmapPrivates(void);
|
||||
|
||||
extern int AllocatePixmapPrivateIndex(void);
|
||||
|
||||
extern Bool AllocatePixmapPrivate(
|
||||
|
@ -95,8 +87,6 @@ extern Bool AllocatePixmapPrivate(
|
|||
int /* index */,
|
||||
unsigned /* amount */);
|
||||
|
||||
extern void ResetColormapPrivates(void);
|
||||
|
||||
|
||||
typedef struct _ColormapRec *ColormapPtr;
|
||||
typedef int (*InitCmapPrivFunc)(ColormapPtr, int);
|
||||
|
|
Loading…
Reference in New Issue
Block a user