diff --git a/dix/main.c b/dix/main.c index eb75cf548..c40dfddb2 100644 --- a/dix/main.c +++ b/dix/main.c @@ -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); diff --git a/dix/privates.c b/dix/privates.c index 0722d9f29..48ba675bf 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -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; diff --git a/include/dix.h b/include/dix.h index 5c2c5b862..13f3c05ff 100644 --- a/include/dix.h +++ b/include/dix.h @@ -591,8 +591,6 @@ void ScreenRestructured (ScreenPtr pScreen); #endif -extern void ResetClientPrivates(void); - extern int AllocateClientPrivateIndex(void); extern Bool AllocateClientPrivate( diff --git a/include/extension.h b/include/extension.h index 74975c50b..27decc12c 100644 --- a/include/extension.h +++ b/include/extension.h @@ -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( diff --git a/include/input.h b/include/input.h index fc607d35b..2350a2456 100644 --- a/include/input.h +++ b/include/input.h @@ -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; diff --git a/include/screenint.h b/include/screenint.h index 1f1434a84..bf8da4432 100644 --- a/include/screenint.h +++ b/include/screenint.h @@ -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);